From 52c0e78be53ea7334ae74bb6541edbbcb44cf881 Mon Sep 17 00:00:00 2001 From: Cameron Reed Date: Sat, 25 Feb 2023 22:00:46 -0700 Subject: [PATCH] Fixed an issue where some crop seeds were null, breaking seed replanting And yes, this is what caused it. I know it seems unrelated --- src/main/java/cmods/haxxor/mixin/GlobalGlow.java | 4 +--- src/main/java/cmods/haxxor/mixin/GlobalGlowAll.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/cmods/haxxor/mixin/GlobalGlow.java b/src/main/java/cmods/haxxor/mixin/GlobalGlow.java index 76a6dec..6373b8e 100644 --- a/src/main/java/cmods/haxxor/mixin/GlobalGlow.java +++ b/src/main/java/cmods/haxxor/mixin/GlobalGlow.java @@ -9,11 +9,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(LivingEntity.class) public class GlobalGlow { - private static final HaxxorOptions options = HaxxorOptions.getInstance(); - @Inject(method = "isGlowing()Z", at = @At("RETURN"), cancellable = true) private void isGlowingOverride(CallbackInfoReturnable cir) { - if (options.glow.enabled.get()) { + if (HaxxorOptions.getInstance().glow.enabled.get()) { cir.setReturnValue(true); } } diff --git a/src/main/java/cmods/haxxor/mixin/GlobalGlowAll.java b/src/main/java/cmods/haxxor/mixin/GlobalGlowAll.java index d65c643..a5525bb 100644 --- a/src/main/java/cmods/haxxor/mixin/GlobalGlowAll.java +++ b/src/main/java/cmods/haxxor/mixin/GlobalGlowAll.java @@ -9,10 +9,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(Entity.class) public class GlobalGlowAll { - private static final HaxxorOptions options = HaxxorOptions.getInstance(); - @Inject(method = "isGlowing()Z", at = @At("RETURN"), cancellable = true) private void isGlowingOverride(CallbackInfoReturnable cir) { + HaxxorOptions options = HaxxorOptions.getInstance(); + if (options.glow.enabled.get() && options.glow.include_non_living.get()) { cir.setReturnValue(true); }