diff --git a/src/main/java/carpetfixes/mixins/entityFixes/EndCrystalEntity_ExplosionChainingMixin.java b/src/main/java/carpetfixes/mixins/entityFixes/EndCrystalEntity_ExplosionChainingMixin.java index cc78a16b..b561b67a 100644 --- a/src/main/java/carpetfixes/mixins/entityFixes/EndCrystalEntity_ExplosionChainingMixin.java +++ b/src/main/java/carpetfixes/mixins/entityFixes/EndCrystalEntity_ExplosionChainingMixin.java @@ -5,7 +5,7 @@ import net.minecraft.entity.decoration.EndCrystalEntity; 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.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(EndCrystalEntity.class) @@ -17,8 +17,9 @@ public class EndCrystalEntity_ExplosionChainingMixin { * they would need to implement an explosion list of entity ticking of sorts * which is too much for a fix to do. */ - @Inject(method = "damage(Lnet/minecraft/entity/damage/DamageSource;F)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/damage/DamageSource;isExplosive()Z"),cancellable = true) - public void isExplosiveBypass(DamageSource source, float amount, CallbackInfoReturnable cir) { - cir.setReturnValue(CarpetFixesSettings.crystalExplodeOnExplodedFix || source.isExplosive()); + @Redirect(method = "damage(Lnet/minecraft/entity/damage/DamageSource;F)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/damage/DamageSource;isExplosive()Z")) + public boolean isExplosiveBypass(DamageSource fakeSource, DamageSource source, float amount) { + if (CarpetFixesSettings.crystalExplodeOnExplodedFix) return false; + return source.isExplosive(); } }