diff --git a/src/main/java/net/frozenblock/lib/core/mixin/BlockEntityTypeMixin.java b/src/main/java/net/frozenblock/lib/core/mixin/BlockEntityTypeMixin.java index e4cc9714..fffb246e 100644 --- a/src/main/java/net/frozenblock/lib/core/mixin/BlockEntityTypeMixin.java +++ b/src/main/java/net/frozenblock/lib/core/mixin/BlockEntityTypeMixin.java @@ -17,6 +17,7 @@ package net.frozenblock.lib.core.mixin; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; import net.minecraft.world.level.block.CeilingHangingSignBlock; import net.minecraft.world.level.block.StandingSignBlock; import net.minecraft.world.level.block.WallHangingSignBlock; @@ -25,8 +26,6 @@ import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(BlockEntityType.class) public class BlockEntityTypeMixin { @@ -34,15 +33,16 @@ public class BlockEntityTypeMixin { /** * This allows custom sign and hanging sign blocks to be added to their block entities */ - @Inject(method = "isValid", at = @At("RETURN"), cancellable = true) - private void isValid(BlockState state, CallbackInfoReturnable info) { + @ModifyReturnValue(method = "isValid", at = @At("RETURN")) + private boolean frozenLib$isValid(boolean original, BlockState state) { var type = BlockEntityType.class.cast(this); if ((type == BlockEntityType.SIGN && (state.getBlock() instanceof StandingSignBlock || state.getBlock() instanceof WallSignBlock)) || (type == BlockEntityType.HANGING_SIGN && (state.getBlock() instanceof CeilingHangingSignBlock || state.getBlock() instanceof WallHangingSignBlock))) { - info.setReturnValue(true); + return true; } + return original; } }