diff options
author | makamys <makamys@outlook.com> | 2023-03-18 12:00:33 +0100 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2023-03-18 12:57:41 +0100 |
commit | 979d794c61a68357d890aeb36966d1db0374e538 (patch) | |
tree | 2421e74b9d68f53811d4966a83be4efed3edc956 /src/main/java/makamys/neodymium/renderer/NeoRenderer.java | |
parent | 36fa2950ba78a10194ac7125167f499d8b3f107d (diff) | |
download | Neodymium-979d794c61a68357d890aeb36966d1db0374e538.tar.gz Neodymium-979d794c61a68357d890aeb36966d1db0374e538.tar.bz2 Neodymium-979d794c61a68357d890aeb36966d1db0374e538.zip |
Lock certain debug features behind creative mode
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoRenderer.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java index 7c11c1a..d75aa43 100644 --- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java +++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java @@ -30,6 +30,7 @@ import makamys.neodymium.Neodymium; import makamys.neodymium.config.Config; import makamys.neodymium.ducks.IWorldRenderer; import makamys.neodymium.renderer.Mesh.GPUStatus; +import makamys.neodymium.util.CheatHelper; import makamys.neodymium.util.GuiHelper; import makamys.neodymium.util.OFUtil; import makamys.neodymium.util.Preprocessor; @@ -241,11 +242,13 @@ public class NeoRenderer { private void handleKeyboard() { if(Config.debugPrefix == 0 || (Config.debugPrefix != -1 && Keyboard.isKeyDown(Config.debugPrefix))) { - if(Keyboard.isKeyDown(Keyboard.KEY_F) && !wasDown[Keyboard.KEY_F]) { - rendererActive = !rendererActive; - } - if(Keyboard.isKeyDown(Keyboard.KEY_V) && !wasDown[Keyboard.KEY_V]) { - renderWorld = !renderWorld; + if(CheatHelper.canCheat()) { + if(Keyboard.isKeyDown(Keyboard.KEY_F) && !wasDown[Keyboard.KEY_F]) { + rendererActive = !rendererActive; + } + if(Keyboard.isKeyDown(Keyboard.KEY_V) && !wasDown[Keyboard.KEY_V]) { + renderWorld = !renderWorld; + } } if(Keyboard.isKeyDown(Keyboard.KEY_R) && !wasDown[Keyboard.KEY_R]) { reloadShader(); @@ -291,11 +294,11 @@ public class NeoRenderer { glUseProgram(shader); updateUniforms(alpha, pass); - if(Config.wireframe) { + if(isWireframeEnabled()) { GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE); } glMultiDrawArrays(GL_QUADS, piFirst[pass], piCount[pass]); - if(Config.wireframe) { + if(isWireframeEnabled()) { GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); } @@ -631,6 +634,10 @@ public class NeoRenderer { return world != null; } + private static boolean isWireframeEnabled() { + return Config.wireframe && CheatHelper.canCheat(); + } + public static class NeoChunkComparator implements Comparator<NeoChunk> { Entity player; |