Minor changes
This commit is contained in:
parent
7f6b4e3520
commit
5c5e86d1d8
@ -9,21 +9,29 @@ import java.util.Objects;
|
|||||||
public class FallDamageCancel {
|
public class FallDamageCancel {
|
||||||
private static final HaxxorOptions options = HaxxorOptions.getInstance();
|
private static final HaxxorOptions options = HaxxorOptions.getInstance();
|
||||||
|
|
||||||
private static final int triggerHeight = 4;
|
private static final int triggerHeight = 6;
|
||||||
private static final float heightAdjust = 0.5f;
|
private static final float heightAdjust = 0.5f;
|
||||||
|
|
||||||
public static void tick(MinecraftClient client) {
|
public static void tick(MinecraftClient client) {
|
||||||
if (!options.cancel_fall_damage || client.world == null || client.player == null || client.player.isOnGround())
|
if (!options.cancel_fall_damage || client.world == null || client.player == null || client.player.isCreative()
|
||||||
|
|| client.player.isOnGround() || client.player.getVelocity().getY() >= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BlockPos playerPos = client.player.getBlockPos();
|
BlockPos playerPos = client.player.getBlockPos();
|
||||||
|
|
||||||
|
if (!client.world.getBlockState(playerPos.up()).isAir() ||
|
||||||
|
!client.world.getBlockState(playerPos.up(2)).isAir()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
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()) {
|
||||||
sendPacket(client);
|
sendPacket(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ public class FlyHack {
|
|||||||
|
|
||||||
private static final HaxxorOptions.FlyHackOptions options = HaxxorOptions.getInstance().flyHack;
|
private static final HaxxorOptions.FlyHackOptions options = HaxxorOptions.getInstance().flyHack;
|
||||||
private static final int ticksToFirst = 40;
|
private static final int ticksToFirst = 40;
|
||||||
private static final int waitTicks = 8;
|
private static final int waitTicks = 5;
|
||||||
private static final float fallDist = 0.5f;
|
private static final float fallDist = 0.5f;
|
||||||
|
|
||||||
private static int tickCounter = ticksToFirst;
|
private static int tickCounter = ticksToFirst;
|
||||||
|
@ -27,7 +27,7 @@ public abstract class HudMixin extends DrawableHelper {
|
|||||||
|
|
||||||
@Inject(at = @At("TAIL"), method = "render")
|
@Inject(at = @At("TAIL"), method = "render")
|
||||||
private void render(MatrixStack matrices, float tickDelta, CallbackInfo callback) {
|
private void render(MatrixStack matrices, float tickDelta, CallbackInfo callback) {
|
||||||
if (this.client.options.debugEnabled || client.player == null)
|
if (this.client.options.debugEnabled || this.client.isPaused() || client.player == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HaxxorOptions options = HaxxorOptions.getInstance();
|
HaxxorOptions options = HaxxorOptions.getInstance();
|
||||||
@ -62,10 +62,18 @@ public abstract class HudMixin extends DrawableHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (Line line: lines) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
|
Line line = lines.get(i);
|
||||||
|
|
||||||
|
if (i > 0 && lines.get(i - 1).indent() > line.indent()) {
|
||||||
|
y += 3;
|
||||||
|
} else if (i > 0 && lines.get(i - 1).indent() < line.indent()) {
|
||||||
|
y += 2;
|
||||||
|
}
|
||||||
|
|
||||||
DrawableHelper.drawTextWithShadow(matrices, textRenderer, line.text(), x + (5 * line.indent()), y,
|
DrawableHelper.drawTextWithShadow(matrices, textRenderer, line.text(), x + (5 * line.indent()), y,
|
||||||
line.color());
|
line.color());
|
||||||
y += 10;
|
y += textRenderer.fontHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user