From cec83b52578a21cc7b0bfca22c3acffe8c5a82a2 Mon Sep 17 00:00:00 2001 From: DJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com> Date: Thu, 22 Oct 2020 08:53:15 -0400 Subject: Fix npe 😳 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit