Skip to content

Commit

Permalink
fix: fix lava bobber injection point by using WrapOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Dec 17, 2023
1 parent cf54512 commit 8cf28e9
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package gg.skytils.skytilsmod.mixins.transformers.entity;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import gg.skytils.skytilsmod.Skytils;
import gg.skytils.skytilsmod.utils.Utils;
import net.minecraft.block.material.Material;
Expand All @@ -36,9 +38,10 @@ public MixinEntityFishHook(World worldIn) {
super(worldIn);
}

@ModifyArg(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isAABBInMaterial(Lnet/minecraft/util/AxisAlignedBB;Lnet/minecraft/block/material/Material;)Z"))
private Material modifyLiquid(AxisAlignedBB aabb, Material materialIn) {
if (!Utils.INSTANCE.getInSkyblock() || !Skytils.Companion.getConfig().getLavaBobber()) return materialIn;
return this.worldObj.isAABBInMaterial(aabb, Material.lava) ? Material.lava : materialIn;
@WrapOperation(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isAABBInMaterial(Lnet/minecraft/util/AxisAlignedBB;Lnet/minecraft/block/material/Material;)Z"))
private boolean allowLavaBobber(World world, AxisAlignedBB aabb, Material materialIn, Operation<Boolean> original) {
boolean orig = original.call(world, aabb, materialIn);
if (!Utils.INSTANCE.getInSkyblock() || !Skytils.Companion.getConfig().getLavaBobber()) return orig;
return this.worldObj.isAABBInMaterial(aabb, Material.lava) || orig;
}
}

0 comments on commit 8cf28e9

Please sign in to comment.