xray working far enough
This commit is contained in:
parent
a0c41b1540
commit
0837516809
|
@ -83,18 +83,20 @@ public class XRay {
|
||||||
private static KeyBinding toggleKey;
|
private static KeyBinding toggleKey;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
toggleKey = KeyBindingHelper.registerKeyBinding( new KeyBinding(
|
toggleKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
"key.mcpht.toggleXray", // Translation of name
|
"key.mcpht.toggleXray", // Translation of name
|
||||||
InputUtil.Type.KEYSYM, // Type: MOUSE or KESYM (Keyboard)
|
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
|
"category.mcpht.rendering" // Translation key for the keybinding category
|
||||||
));
|
));
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||||
// NOTE: IDK why we need a while here
|
// NOTE: IDK why we need a while here
|
||||||
while (toggleKey.wasPressed()) {
|
while (toggleKey.wasPressed()) {
|
||||||
MCPHTClient.LOGGER.info(String.format("toggle XRay: %s", MCPHTClient.XRAY.enable));
|
if (MCPHTClient.XRAY.getEnable()) {
|
||||||
MCPHTClient.XRAY.enable = !MCPHTClient.XRAY.enable;
|
MCPHTClient.LOGGER.info(String.format("toggle XRay: %s", MCPHTClient.XRAY.enable));
|
||||||
MCPHTClient.MC.worldRenderer.reload();
|
MCPHTClient.XRAY.enable = !MCPHTClient.XRAY.enable;
|
||||||
|
MCPHTClient.MC.worldRenderer.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue