From 4e5f1eee9e360b6c196b750e0d7d05cf6e7b9539 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Sun, 30 Jun 2024 23:56:51 +0200 Subject: [PATCH] Fix NeoForge 21.0.40+ (#530) --- .../dev/architectury/core/block/ArchitecturyLiquidBlock.java | 2 +- .../dev/architectury/core/fluid/ArchitecturyFlowingFluid.java | 2 +- .../dev/architectury/core/item/ArchitecturyBucketItem.java | 2 +- .../dev/architectury/core/item/ArchitecturyMobBucketItem.java | 2 +- gradle.properties | 4 ++-- .../architectury/hooks/item/tool/forge/HoeItemHooksImpl.java | 4 ++-- neoforge/src/main/resources/META-INF/neoforge.mods.toml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/dev/architectury/core/block/ArchitecturyLiquidBlock.java b/common/src/main/java/dev/architectury/core/block/ArchitecturyLiquidBlock.java index 967223528..500cc7ca7 100644 --- a/common/src/main/java/dev/architectury/core/block/ArchitecturyLiquidBlock.java +++ b/common/src/main/java/dev/architectury/core/block/ArchitecturyLiquidBlock.java @@ -31,7 +31,7 @@ public ArchitecturyLiquidBlock(Supplier fluid, Propertie } private static T checkPlatform(T obj) { - if (Platform.isForge()) { + if (Platform.isForgeLike()) { throw new IllegalStateException("This class should've been replaced on Forge!"); } diff --git a/common/src/main/java/dev/architectury/core/fluid/ArchitecturyFlowingFluid.java b/common/src/main/java/dev/architectury/core/fluid/ArchitecturyFlowingFluid.java index 652949d28..040e89c9e 100644 --- a/common/src/main/java/dev/architectury/core/fluid/ArchitecturyFlowingFluid.java +++ b/common/src/main/java/dev/architectury/core/fluid/ArchitecturyFlowingFluid.java @@ -55,7 +55,7 @@ public abstract class ArchitecturyFlowingFluid extends FlowingFluid { } private static T checkPlatform(T obj) { - if (Platform.isForge()) { + if (Platform.isForgeLike()) { throw new IllegalStateException("This class should've been replaced on Forge!"); } diff --git a/common/src/main/java/dev/architectury/core/item/ArchitecturyBucketItem.java b/common/src/main/java/dev/architectury/core/item/ArchitecturyBucketItem.java index 6b03521ec..bc8504849 100644 --- a/common/src/main/java/dev/architectury/core/item/ArchitecturyBucketItem.java +++ b/common/src/main/java/dev/architectury/core/item/ArchitecturyBucketItem.java @@ -32,7 +32,7 @@ public ArchitecturyBucketItem(Supplier fluid, Properties proper } private static T checkPlatform(T obj) { - if (Platform.isForge()) { + if (Platform.isForgeLike()) { throw new IllegalStateException("This class should've been replaced on Forge!"); } diff --git a/common/src/main/java/dev/architectury/core/item/ArchitecturyMobBucketItem.java b/common/src/main/java/dev/architectury/core/item/ArchitecturyMobBucketItem.java index b3d3a5b7d..41eb000f2 100644 --- a/common/src/main/java/dev/architectury/core/item/ArchitecturyMobBucketItem.java +++ b/common/src/main/java/dev/architectury/core/item/ArchitecturyMobBucketItem.java @@ -33,7 +33,7 @@ public ArchitecturyMobBucketItem(Supplier> entity, Suppl } private static T checkPlatform(T obj) { - if (Platform.isForge()) { + if (Platform.isForgeLike()) { throw new IllegalStateException("This class should've been replaced on Forge!"); } diff --git a/gradle.properties b/gradle.properties index 56c5eb154..de35d79fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,10 +16,10 @@ version_suffix= fabric_loader_version=0.15.11 fabric_api_version=0.100.0+1.21 -mod_menu_version=10.0.0-beta.1 +mod_menu_version=11.0.1 forge_version=51.0.0 -neoforge_version=21.0.31-beta +neoforge_version=21.0.42-beta # Set to empty if not snapshots neoforge_pr= diff --git a/neoforge/src/main/java/dev/architectury/hooks/item/tool/forge/HoeItemHooksImpl.java b/neoforge/src/main/java/dev/architectury/hooks/item/tool/forge/HoeItemHooksImpl.java index 274c5ba62..ecb58dc90 100644 --- a/neoforge/src/main/java/dev/architectury/hooks/item/tool/forge/HoeItemHooksImpl.java +++ b/neoforge/src/main/java/dev/architectury/hooks/item/tool/forge/HoeItemHooksImpl.java @@ -22,8 +22,8 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.common.ItemAbilities; import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.common.ToolActions; import net.neoforged.neoforge.event.level.BlockEvent; import java.util.function.Consumer; @@ -34,7 +34,7 @@ public class HoeItemHooksImpl { public static void addTillable(Block input, Predicate predicate, Consumer action, Function function) { NeoForge.EVENT_BUS.addListener(event -> { UseOnContext context = event.getContext(); - if (ToolActions.HOE_TILL == event.getToolAction() && context.getItemInHand().canPerformAction(ToolActions.HOE_TILL) + if (ItemAbilities.HOE_TILL == event.getItemAbility() && context.getItemInHand().canPerformAction(ItemAbilities.HOE_TILL) && event.getState().is(input) && predicate.test(context)) { if (!event.isSimulated()) { action.accept(context); diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index cf219e4aa..8be17fc4b 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -24,7 +24,7 @@ side = "BOTH" [[dependencies.architectury]] modId = "neoforge" type = "required" -versionRange = "[20.1.31-beta,)" +versionRange = "[21.0.40-beta,)" ordering = "NONE" side = "BOTH"