Skip to content

Commit

Permalink
Switch to ModifyReturnValue over a more brittle Inject
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Dec 19, 2024
1 parent 55be4fc commit a8c0088
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/gripe/_90/megacells/mixin/ItemEntityMixin.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<Boolean> 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"})
Expand Down

0 comments on commit a8c0088

Please sign in to comment.