Skip to content

Commit

Permalink
Revert "Update VisibleControls.java"
Browse files Browse the repository at this point in the history
This reverts commit 17f243c.
  • Loading branch information
AmyMialee committed May 28, 2022
1 parent 17f243c commit aaff5ee
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/main/java/amymialee/visiblebarriers/VisibleControls.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@
@SuppressWarnings("SameParameterValue")
public class VisibleControls {
public static final KeyBinding VISIBILITY = createSafeKeyMapping("key.%s.visibility".formatted(VisibleBarriers.MOD_ID), GLFW.GLFW_KEY_B);
private static boolean visibilityHeld = false;

public static void keyInput(int key, int scancode) {
ClientPlayerEntity player = MinecraftClient.getInstance().player;
if (player != null) {
if (VISIBILITY.matchesKey(key, scancode)) {
if (!visibilityHeld) {
VisibleBarriers.visible = !VisibleBarriers.visible;
if (MinecraftClient.getInstance().player != null && MinecraftClient.getInstance().player.isSneaking()) {
VisibleBarriers.visible_air = VisibleBarriers.visible;
}
if (!VisibleBarriers.visible) {
VisibleBarriers.visible_air = false;
}
MinecraftClient.getInstance().worldRenderer.reload();
visibilityHeld = true;
VisibleBarriers.visible = !VisibleBarriers.visible;
if (MinecraftClient.getInstance().player != null && MinecraftClient.getInstance().player.isSneaking()) {
VisibleBarriers.visible_air = VisibleBarriers.visible;
}
} else {
visibilityHeld = false;
if (!VisibleBarriers.visible) {
VisibleBarriers.visible_air = false;
}
MinecraftClient.getInstance().worldRenderer.reload();
}
}
}
Expand Down

0 comments on commit aaff5ee

Please sign in to comment.