Skip to content

Commit

Permalink
Option: pause NoFall if mace in hand
Browse files Browse the repository at this point in the history
  • Loading branch information
Big-Iron-Cheems authored and Wide-Cat committed Feb 5, 2025
1 parent 4c0af90 commit 85a9a78
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.item.MaceItem;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
Expand Down Expand Up @@ -80,6 +81,13 @@ public class NoFall extends Module {
.build()
);

private final Setting<Boolean> pauseOnMace = sgGeneral.add(new BoolSetting.Builder()
.name("pause-on-mace")
.description("Pauses NoFall when using a mace.")
.defaultValue(true)
.build()
);

private boolean placedWater;
private BlockPos targetPos;
private int timer;
Expand All @@ -104,6 +112,7 @@ public void onDeactivate() {

@EventHandler
private void onSendPacket(PacketEvent.Send event) {
if (pauseOnMace.get() && mc.player.getMainHandStack().getItem() instanceof MaceItem) return;
if (mc.player.getAbilities().creativeMode
|| !(event.packet instanceof PlayerMoveC2SPacket)
|| mode.get() != Mode.Packet
Expand All @@ -127,6 +136,7 @@ private void onTick(TickEvent.Pre event) {
}

if (mc.player.getAbilities().creativeMode) return;
if (pauseOnMace.get() && mc.player.getMainHandStack().getItem() instanceof MaceItem) return;

// Airplace mode
if (mode.get() == Mode.AirPlace) {
Expand Down

0 comments on commit 85a9a78

Please sign in to comment.