diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2022-10-13 22:21:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-13 16:21:01 -0400 |
commit | c1e711d270693e198781f3b6591f95c14eb5a6d1 (patch) | |
tree | 380daf5a7cf2fe2bef4a677674863edaa0d7dac3 /src | |
parent | 54eea328ad47ff55f3c8498fdc13e61a30200087 (diff) | |
download | NotEnoughUpdates-c1e711d270693e198781f3b6591f95c14eb5a6d1.tar.gz NotEnoughUpdates-c1e711d270693e198781f3b6591f95c14eb5a6d1.tar.bz2 NotEnoughUpdates-c1e711d270693e198781f3b6591f95c14eb5a6d1.zip |
NPE Fix (#364)
prevent an npe
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index c77a4b39..452f8a9b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -213,12 +213,14 @@ public class CustomItemEffects { @SubscribeEvent public void onGameTick(TickEvent.ClientTickEvent event) { if (event.phase != TickEvent.Phase.END) return; + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player == null) return; if (!usingEtherwarp && wasUsingEtherwarp) { - if (Minecraft.getMinecraft().thePlayer.rotationYaw > 0) { - Minecraft.getMinecraft().thePlayer.rotationYaw -= 0.000001; + if (player.rotationYaw > 0) { + player.rotationYaw -= 0.000001; } else { - Minecraft.getMinecraft().thePlayer.rotationYaw += 0.000001; + player.rotationYaw += 0.000001; } } wasUsingEtherwarp = usingEtherwarp; |