From 41034eee65b3b866cee9aac029e16f04a97e4773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Fabi=C3=A1nek?= Date: Thu, 11 Jul 2024 16:02:52 +0200 Subject: [PATCH] port --- build.gradle | 13 ++++++++----- .../fabric/BeekeeperHutArmorStandProcessor.java | 4 ++-- .../fabric/BeekeeperHutItemFrameProcessor.java | 4 ++-- fabric/src/main/resources/fabric.mod.json | 2 +- gradle.properties | 13 +++++++------ .../beekeeperhut/neoforge/BeekeeperHutNeoForge.java | 4 ++-- .../neoforge/BeekeeperHutArmorStandProcessor.java | 4 ++-- .../neoforge/BeekeeperHutItemFrameProcessor.java | 4 ++-- .../META-INF/{mods.toml => neoforge.mods.toml} | 0 9 files changed, 26 insertions(+), 22 deletions(-) rename neoforge/src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (100%) diff --git a/build.gradle b/build.gradle index 7193c63..0cf67d3 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,10 @@ subprojects { dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" - mappings "net.fabricmc:yarn:${yarn_mappings}" + mappings loom.layered { + it.mappings "net.fabricmc:yarn:${yarn_mappings}" + it.mappings "dev.architectury:yarn-mappings-patch-neoforge:${yarn_mappings_patch}" + } } } @@ -40,7 +43,7 @@ allprojects { "friendsAndFoesVersion": friendsandfoes_version ] - filesMatching(['fabric.mod.json', 'META-INF/mods.toml']) { + filesMatching(['fabric.mod.json', 'META-INF/neoforge.mods.toml']) { expand expandProps } @@ -55,13 +58,13 @@ allprojects { } tasks.withType(JavaCompile).configureEach { - it.options.release = 17 + it.options.release = 21 } java { withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } } diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutArmorStandProcessor.java b/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutArmorStandProcessor.java index a9bbaf5..b4a3ef7 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutArmorStandProcessor.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutArmorStandProcessor.java @@ -4,6 +4,7 @@ import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutArmorStandProcessorHelper; import com.faboslav.friendsandfoes.beekeeperhut.world.processor.StructureEntityProcessor; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.processor.StructureProcessorType; @@ -18,8 +19,7 @@ */ public final class BeekeeperHutArmorStandProcessor extends StructureEntityProcessor { - public static final BeekeeperHutArmorStandProcessor INSTANCE = new BeekeeperHutArmorStandProcessor(); - public static final Codec CODEC = Codec.unit(() -> INSTANCE); + public static final MapCodec CODEC = MapCodec.unit(BeekeeperHutArmorStandProcessor::new); @Override public StructureTemplate.StructureEntityInfo processEntity( diff --git a/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutItemFrameProcessor.java b/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutItemFrameProcessor.java index 4b655da..984a59a 100644 --- a/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutItemFrameProcessor.java +++ b/fabric/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/fabric/BeekeeperHutItemFrameProcessor.java @@ -4,6 +4,7 @@ import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutItemFrameProcessorHelper; import com.faboslav.friendsandfoes.beekeeperhut.world.processor.StructureEntityProcessor; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.StructureTemplate.StructureEntityInfo; @@ -19,8 +20,7 @@ */ public final class BeekeeperHutItemFrameProcessor extends StructureEntityProcessor { - public static final BeekeeperHutItemFrameProcessor INSTANCE = new BeekeeperHutItemFrameProcessor(); - public static final Codec CODEC = Codec.unit(() -> INSTANCE); + public static final MapCodec CODEC = MapCodec.unit(BeekeeperHutItemFrameProcessor::new); @Override public StructureEntityInfo processEntity( diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index aa54f7a..dd8b954 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -23,7 +23,7 @@ ] }, "depends": { - "java": ">=17", + "java": ">=21", "minecraft": ">=${minMinecraftVersion}", "fabricloader": ">=${fabricLoaderVersion}", "fabric": ">=${fabricApiVersion}", diff --git a/gradle.properties b/gradle.properties index d8365c0..a184299 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,11 +12,12 @@ mod_description=An addon for the Friends&Foes mod, adding a beekeeper hut struct maven_group=com.faboslav.friendsandfoes.beekeeperhut # Minecraft -minecraft_version=1.20.4 -min_minecraft_version=1.20.3 +minecraft_version=1.20.6 +min_minecraft_version=1.20.5 #Mappings -yarn_mappings=1.20.4+build.3:v2 +yarn_mappings=1.20.6+build.1:v2 +yarn_mappings_patch=1.20.5+build.3 # Architectury enabled_platforms=fabric,neoforge @@ -26,8 +27,8 @@ mixin_extras_version=0.3.6 friendsandfoes_version=2.0.11 # Fabric https://fabricmc.net/versions.html -fabric_loader_version=0.15.3 -fabric_api_version=0.92.0+1.20.4 +fabric_loader_version=0.15.11 +fabric_api_version=0.98.0+1.20.6 # Neoforge https://projects.neoforged.net/neoforged/neoforge -neoforge_version=20.4.237 +neoforge_version=20.6.119 diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/neoforge/BeekeeperHutNeoForge.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/neoforge/BeekeeperHutNeoForge.java index 5c7a440..c34367f 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/neoforge/BeekeeperHutNeoForge.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/neoforge/BeekeeperHutNeoForge.java @@ -3,15 +3,15 @@ import com.faboslav.friendsandfoes.beekeeperhut.BeekeeperHut; import com.faboslav.friendsandfoes.beekeeperhut.platform.neoforge.RegistryHelperImpl; import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; @Mod(BeekeeperHut.MOD_ID) public final class BeekeeperHutNeoForge { - public BeekeeperHutNeoForge() { + public BeekeeperHutNeoForge(ModContainer modContainer, IEventBus modEventBus) { BeekeeperHut.init(); - IEventBus modEventBus = net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext.get().getModEventBus(); RegistryHelperImpl.STRUCTURE_PROCESSOR_TYPES.register(modEventBus); } } diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutArmorStandProcessor.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutArmorStandProcessor.java index 6afc349..710b078 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutArmorStandProcessor.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutArmorStandProcessor.java @@ -3,6 +3,7 @@ import com.faboslav.friendsandfoes.beekeeperhut.platform.neoforge.StructureEntityProcessorTypesImpl; import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutArmorStandProcessorHelper; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.processor.StructureProcessor; @@ -13,8 +14,7 @@ public final class BeekeeperHutArmorStandProcessor extends StructureProcessor { - public static final BeekeeperHutArmorStandProcessor INSTANCE = new BeekeeperHutArmorStandProcessor(); - public static final Codec CODEC = Codec.unit(() -> INSTANCE); + public static final MapCodec CODEC = MapCodec.unit(BeekeeperHutArmorStandProcessor::new); @Override public StructureTemplate.StructureEntityInfo processEntity( diff --git a/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutItemFrameProcessor.java b/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutItemFrameProcessor.java index 0541a49..9571f8c 100644 --- a/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutItemFrameProcessor.java +++ b/neoforge/src/main/java/com/faboslav/friendsandfoes/beekeeperhut/world/processor/neoforge/BeekeeperHutItemFrameProcessor.java @@ -3,6 +3,7 @@ import com.faboslav.friendsandfoes.beekeeperhut.platform.neoforge.StructureEntityProcessorTypesImpl; import com.faboslav.friendsandfoes.beekeeperhut.util.world.processor.BeekeeperHutItemFrameProcessorHelper; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import net.minecraft.structure.StructurePlacementData; import net.minecraft.structure.StructureTemplate; import net.minecraft.structure.processor.StructureProcessor; @@ -13,8 +14,7 @@ public final class BeekeeperHutItemFrameProcessor extends StructureProcessor { - public static final BeekeeperHutItemFrameProcessor INSTANCE = new BeekeeperHutItemFrameProcessor(); - public static final Codec CODEC = Codec.unit(() -> INSTANCE); + public static final MapCodec CODEC = MapCodec.unit(BeekeeperHutItemFrameProcessor::new); @Override public StructureTemplate.StructureEntityInfo processEntity( diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml similarity index 100% rename from neoforge/src/main/resources/META-INF/mods.toml rename to neoforge/src/main/resources/META-INF/neoforge.mods.toml