From a8c0088c9083e45f593a07dcede91d3fa263c27f Mon Sep 17 00:00:00 2001 From: 90 Date: Thu, 19 Dec 2024 15:54:41 +0000 Subject: [PATCH] Switch to `ModifyReturnValue` over a more brittle `Inject` --- .../java/gripe/_90/megacells/mixin/ItemEntityMixin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/gripe/_90/megacells/mixin/ItemEntityMixin.java b/src/main/java/gripe/_90/megacells/mixin/ItemEntityMixin.java index fb4acd82..626b03c4 100644 --- a/src/main/java/gripe/_90/megacells/mixin/ItemEntityMixin.java +++ b/src/main/java/gripe/_90/megacells/mixin/ItemEntityMixin.java @@ -1,11 +1,12 @@ package gripe._90.megacells.mixin; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.core.BlockPos; import net.minecraft.tags.FluidTags; @@ -30,9 +31,9 @@ public ItemEntityMixin(EntityType type, Level level) { @Unique private int mega$lavaTicks; - @Inject(method = "fireImmune", at = @At("RETURN"), cancellable = true) - private void handleLavaTransform(CallbackInfoReturnable cir) { - cir.setReturnValue(cir.getReturnValue() || mega$lavaImmune); + @ModifyReturnValue(method = "fireImmune", at = @At("RETURN")) + private boolean lavaImmune(boolean original) { + return original || mega$lavaImmune; } @SuppressWarnings({"resource", "UnreachableCode"})