Skip to content

Commit cec83b5

Browse files
Fix npe 😳
1 parent ab4eb74 commit cec83b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/me/djtheredstoner/perspectivemod/PerspectiveMod.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ public void init(FMLInitializationEvent event) {
5252
@SubscribeEvent
5353
public void tick(TickEvent.RenderTickEvent event) {
5454
boolean down = GameSettings.isKeyDown(perspectiveKey);
55-
if(down != prevState && mc.currentScreen == null) {
55+
if(down != prevState && mc.currentScreen == null && mc.theWorld != null && mc.thePlayer != null) {
5656
prevState = down;
57-
onPressed(0, down);
57+
onPressed(down);
5858
}
5959
}
6060

@@ -72,7 +72,7 @@ public void onWorldLoad(WorldEvent.Load event) {
7272
}
7373
}
7474

75-
public void onPressed(int eventKey, boolean state) {
75+
public void onPressed(boolean state) {
7676
if (config.modEnabled) {
7777
if (state) {
7878
perspectiveToggled = !perspectiveToggled;

0 commit comments

Comments
 (0)