diff --git a/gradle.properties b/gradle.properties index 11e0896..f21adcf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ yarn_mappings=1.16.1+build.21 loader_version=0.9.0+build.204 #Fabric api -fabric_version=0.14.1+build.372-1.16 +fabric_version=0.16.0+build.384-1.16.1 # Mod Properties mod_version = 1.4.7 diff --git a/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java b/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java index 66dc03e..a504c47 100644 --- a/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java +++ b/src/main/java/org/samo_lego/simpleauth/SimpleAuth.java @@ -164,12 +164,13 @@ public class SimpleAuth implements DedicatedServerModInitializer { // Authenticates player and sends the message public static void authenticatePlayer(ServerPlayerEntity player, Text msg) { + PlayerCache playerCache = deauthenticatedUsers.get(convertUuid(player)); // Teleporting player back if(config.main.spawnOnJoin) teleportPlayer(player, false); // Updating blocks if needed (if portal rescue action happened) - if(deauthenticatedUsers.get(convertUuid(player)).wasInPortal) { + if(playerCache.wasInPortal) { World world = player.getEntityWorld(); BlockPos pos = player.getBlockPos(); @@ -181,7 +182,7 @@ public class SimpleAuth implements DedicatedServerModInitializer { // Setting last air to player if(player.isSubmergedInWater()) - player.setAir(deauthenticatedUsers.get(convertUuid(player)).lastAir); + player.setAir(playerCache.lastAir); deauthenticatedUsers.remove(convertUuid(player)); 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 3752119..5d65858 100644 --- a/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java +++ b/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java @@ -76,7 +76,7 @@ public class AuthEventHandler { playerCache.validUntil >= System.currentTimeMillis() && player.getIp().equals(playerCache.lastIp) ) { - deauthenticatedUsers.remove(uuid); // Makes player authenticated + authenticatePlayer(player, null); // Makes player authenticated return; } // Invalidating session