diff --git a/src/main/java/com/matt/forgehax/Helper.java b/src/main/java/com/matt/forgehax/Helper.java index fd92d6c2b..20a2c6543 100644 --- a/src/main/java/com/matt/forgehax/Helper.java +++ b/src/main/java/com/matt/forgehax/Helper.java @@ -66,6 +66,7 @@ public static Entity getRidingOrPlayer() { return getRidingEntity() != null ? getRidingEntity() : getLocalPlayer(); } + @Nullable public static WorldClient getWorld() { return MC.world; } diff --git a/src/main/java/com/matt/forgehax/mods/LogoutSpot.java b/src/main/java/com/matt/forgehax/mods/LogoutSpot.java index 9a4de5488..0c5637e63 100644 --- a/src/main/java/com/matt/forgehax/mods/LogoutSpot.java +++ b/src/main/java/com/matt/forgehax/mods/LogoutSpot.java @@ -98,6 +98,8 @@ public void onPlayerConnect(PlayerConnectEvent.Join event) { @SubscribeEvent public void onPlayerDisconnect(PlayerConnectEvent.Leave event) { + if (getWorld() == null) return; + EntityPlayer player = getWorld().getPlayerEntityByUUID(event.getPlayerInfo().getId()); if (player != null && getLocalPlayer() != null && !getLocalPlayer().equals(player)) { AxisAlignedBB bb = player.getEntityBoundingBox();