Skip to content

Commit

Permalink
Fix NeoForge 21.0.40+ (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx authored Jun 30, 2024
1 parent 1ba751a commit 4e5f1ee
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ArchitecturyLiquidBlock(Supplier<? extends FlowingFluid> fluid, Propertie
}

private static <T> T checkPlatform(T obj) {
if (Platform.isForge()) {
if (Platform.isForgeLike()) {
throw new IllegalStateException("This class should've been replaced on Forge!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class ArchitecturyFlowingFluid extends FlowingFluid {
}

private static <T> T checkPlatform(T obj) {
if (Platform.isForge()) {
if (Platform.isForgeLike()) {
throw new IllegalStateException("This class should've been replaced on Forge!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ArchitecturyBucketItem(Supplier<? extends Fluid> fluid, Properties proper
}

private static <T> T checkPlatform(T obj) {
if (Platform.isForge()) {
if (Platform.isForgeLike()) {
throw new IllegalStateException("This class should've been replaced on Forge!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public ArchitecturyMobBucketItem(Supplier<? extends EntityType<?>> entity, Suppl
}

private static <T> T checkPlatform(T obj) {
if (Platform.isForge()) {
if (Platform.isForgeLike()) {
throw new IllegalStateException("This class should've been replaced on Forge!");
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,7 +34,7 @@ public class HoeItemHooksImpl {
public static void addTillable(Block input, Predicate<UseOnContext> predicate, Consumer<UseOnContext> action, Function<UseOnContext, BlockState> function) {
NeoForge.EVENT_BUS.<BlockEvent.BlockToolModificationEvent>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);
Expand Down
2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 4e5f1ee

Please sign in to comment.