diff options
author | DJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com> | 2020-10-22 08:53:15 -0400 |
---|---|---|
committer | DJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com> | 2020-10-22 08:53:15 -0400 |
commit | cec83b52578a21cc7b0bfca22c3acffe8c5a82a2 (patch) | |
tree | 2883c5e4712a5bd5b60a6c72235b2229baa7bac7 | |
parent | ab4eb74fb5af37b7eaf5e9faa95debb75721d269 (diff) | |
download | PerspectiveModv4-cec83b52578a21cc7b0bfca22c3acffe8c5a82a2.tar.gz PerspectiveModv4-cec83b52578a21cc7b0bfca22c3acffe8c5a82a2.tar.bz2 PerspectiveModv4-cec83b52578a21cc7b0bfca22c3acffe8c5a82a2.zip |
Fix npe 😳
-rw-r--r-- | src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java b/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java index 34e3b13..afa0e49 100644 --- a/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java +++ b/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java @@ -52,9 +52,9 @@ public class PerspectiveMod { @SubscribeEvent public void tick(TickEvent.RenderTickEvent event) { boolean down = GameSettings.isKeyDown(perspectiveKey); - if(down != prevState && mc.currentScreen == null) { + if(down != prevState && mc.currentScreen == null && mc.theWorld != null && mc.thePlayer != null) { prevState = down; - onPressed(0, down); + onPressed(down); } } @@ -72,7 +72,7 @@ public class PerspectiveMod { } } - public void onPressed(int eventKey, boolean state) { + public void onPressed(boolean state) { if (config.modEnabled) { if (state) { perspectiveToggled = !perspectiveToggled; |