Created
June 19, 2022 16:32
-
-
Save Lothrazar/8b09e69fbe4cc8f003e1de6740ee3c9b to your computer and use it in GitHub Desktop.
forge 1.18.2 porting to 1.19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clone new copy of source code, dont use a 1.18 workspace. | |
IE make new root folder C:\code\mc119 | |
git clone [email protected]:Lothrazar/ForgeTemplate.git | |
Download forge mdk zip. we will need the following files. | |
https://files.minecraftforge.net/net/minecraftforge/forge/index_1.19.html | |
/gradle/ | |
settings.gradle | |
gradlew.bat | |
gradlew | |
^copy all those into your mod src overwrite all | |
edit gradle.properties (use newer as they come out): | |
mc_version=1.19 | |
forge_version=41.0.38 | |
# optional dependencies | |
jei_version=11.0.0.206 | |
replace entire top build.gradle with the plugins section below. compare to mdk/build.gradle to be sure. | |
and delete any plugins not needed, cleanup tasks and scripts as needed | |
java version should be 17 already update if needed | |
make sure you update mappings channel: 'official', version: '1.19' | |
plugins { | |
id 'eclipse' | |
id 'maven-publish' | |
id 'net.minecraftforge.gradle' version '5.1.+' | |
} | |
java.toolchain.languageVersion = JavaLanguageVersion.of(17) | |
Import as a new project into IntelliJ or Eclipse | |
run gradle task genEclipseRuns or genIntellijRuns | |
verify your mods.toml and mod version number in your build and gradle files | |
fix code good luck | |
test in game and ./gradlew build when ready | |
bonus section of mojang changes: | |
- TranslatableComponent(..) is now Component.translatable(..) | |
- | |
Loot serializer change
@SubscribeEvent
public static void onBlocksRegistry(RegisterEvent event) {
event.register(ForgeRegistries.Keys.LOOT_MODIFIER_SERIALIZERS, r -> {
r.register(new ResourceLocation(NutsAndFruitMod.MODID + ":loot"), new LootTableMod.Serializer());
});
}
//
// @SubscribeEvent
// public static void registerModifierSerializers(final RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) {
// event.getRegistry().register(new LootTableMod.Serializer().setRegistryName(NutsAndFruitMod.MODID + ":loot"));
// }
registry change is easy
stack.getItem().getRegistryName();
// becomes
ForgeRegistries.ITEMS.getKey(stack.getItem());
latest mappings SRG https://gist.github.com/SizableShrimp/882a671ff74256d150776da08c89ef72
fluid.getAttributes()
became
IClientFluidTypeExtensions fluidAttributes = IClientFluidTypeExtensions.of(fluid);
KeyInputEvent
->
ScreenEvent.KeyPressed.Post
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for JEI maven as needed https://github.com/mezz/JustEnoughItems/wiki/Getting-Started-%5BJEI-10-or-higher-for-Forge-or-Fabric%5D#repositories
https://github.com/Lothrazar/AbsentByDesign/blob/trunk/1.19/build.gradle#L88
===