xray working far enough

This commit is contained in:
Christoph J. Scherr 2023-11-12 13:01:27 +01:00
parent a0c41b1540
commit 0837516809
1 changed files with 7 additions and 5 deletions

View File

@ -86,16 +86,18 @@ public class XRay {
toggleKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.mcpht.toggleXray", // Translation of name
InputUtil.Type.KEYSYM, // Type: MOUSE or KESYM (Keyboard)
GLFW.GLFW_KEY_R, // The keycode of the key (default?)
GLFW.GLFW_KEY_X, // The keycode of the key (default?)
"category.mcpht.rendering" // Translation key for the keybinding category
));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
// NOTE: IDK why we need a while here
while (toggleKey.wasPressed()) {
if (MCPHTClient.XRAY.getEnable()) {
MCPHTClient.LOGGER.info(String.format("toggle XRay: %s", MCPHTClient.XRAY.enable));
MCPHTClient.XRAY.enable = !MCPHTClient.XRAY.enable;
MCPHTClient.MC.worldRenderer.reload();
}
}
});
}