Compare commits

..

2 Commits

2 changed files with 2 additions and 15 deletions

View File

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

View File

@ -34,7 +34,7 @@ public class FlyHack {
} }
} }
public static void fakeFall(MinecraftClient client) { private static void fakeFall(MinecraftClient client) {
if (client.player == null) if (client.player == null)
return; return;