diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinBiomeGenBase.java b/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinBiomeGenBase.java index ddf44bb8..6342ed66 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinBiomeGenBase.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/early/minecraft/MixinBiomeGenBase.java @@ -5,8 +5,8 @@ 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.CallbackInfoReturnable; + +import com.llamalad7.mixinextras.injector.ModifyReturnValue; @Mixin(BiomeGenBase.class) public abstract class MixinBiomeGenBase { @@ -14,8 +14,8 @@ public abstract class MixinBiomeGenBase { @Unique private static final float ABSOLUTE_ZERO = -459.67f / 100f; // in Fahrenheit scale - @Inject(method = "getFloatTemperature", at = @At("RETURN"), cancellable = true) - public final void hodgepodge$getFloatTemperature(int x, int y, int z, CallbackInfoReturnable cir) { - cir.setReturnValue(Math.max(cir.getReturnValue(), ABSOLUTE_ZERO)); + @ModifyReturnValue(method = "getFloatTemperature", at = @At("RETURN")) + public final float hodgepodge$getFloatTemperature(float original) { + return Math.max(original, ABSOLUTE_ZERO); } }