Removed a couple lines that made it into the last commit

This commit is contained in:
Cameron Reed 2022-12-08 21:45:55 -07:00
parent 2b807d8428
commit 50a6224fa8

View File

@ -12,30 +12,17 @@ public class FallDamageCancel {
private static final int triggerHeight = 4;
private static final float heightAdjust = 0.5f;
// private static boolean triggered = false;
public static void tick(MinecraftClient client) {
if (!options.cancel_fall_damage || client.world == null || client.player == null)
if (!options.cancel_fall_damage || client.world == null || client.player == null || client.player.isOnGround())
return;
if (client.player.isOnGround()) {
// triggered = false;
return;
}
// if (triggered) {
// return;
// }
BlockPos playerPos = client.player.getBlockPos();
for (int i = 0; i < triggerHeight; i++) {
if (!client.world.getBlockState(playerPos.down(i)).isAir()) {
float totalFallDist = client.player.fallDistance + i;
if (totalFallDist >= client.player.getSafeFallDistance()) {
System.out.println("Attempting to negate fall damage");
sendPacket(client);
// triggered = true;
}
}
}