From fcab8f8a4605aa32438864e8dab006f4b6b05232 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Sun, 11 Oct 2020 17:33:25 +0200 Subject: [PATCH] Fixing #25 --- .../simpleauth/event/AuthEventHandler.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java b/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java index 4040a4d..d42395c 100644 --- a/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java +++ b/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java @@ -121,14 +121,16 @@ public class AuthEventHandler { playerCache.lastAir = player.getAir(); playerCache.wasOnFire = player.isOnFire(); playerCache.wasInPortal = player.getBlockState().getBlock().equals(Blocks.NETHER_PORTAL); - playerCache.lastDim = String.valueOf(player.getEntityWorld().getRegistryKey().getValue()); - playerCache.lastX = player.getX(); - playerCache.lastY = player.getY(); - playerCache.lastZ = player.getZ(); + if(isAuthenticated(player)) { + playerCache.lastDim = String.valueOf(player.getEntityWorld().getRegistryKey().getValue()); + playerCache.lastX = player.getX(); + playerCache.lastY = player.getY(); + playerCache.lastZ = player.getZ(); - // Setting the session expire time - if(isAuthenticated(player) && config.main.sessionTimeoutTime != -1) - playerCache.validUntil = System.currentTimeMillis() + config.main.sessionTimeoutTime * 1000; + // Setting the session expire time + if(config.main.sessionTimeoutTime != -1) + playerCache.validUntil = System.currentTimeMillis() + config.main.sessionTimeoutTime * 1000; + } } // Player chatting