Minor change

This commit is contained in:
samo_lego 2020-07-27 09:28:34 +02:00
parent f522334305
commit fa1557a577
3 changed files with 5 additions and 4 deletions

View File

@ -7,7 +7,7 @@ yarn_mappings=1.16.1+build.21
loader_version=0.9.0+build.204 loader_version=0.9.0+build.204
#Fabric api #Fabric api
fabric_version=0.14.1+build.372-1.16 fabric_version=0.16.0+build.384-1.16.1
# Mod Properties # Mod Properties
mod_version = 1.4.7 mod_version = 1.4.7

View File

@ -164,12 +164,13 @@ public class SimpleAuth implements DedicatedServerModInitializer {
// Authenticates player and sends the message // Authenticates player and sends the message
public static void authenticatePlayer(ServerPlayerEntity player, Text msg) { public static void authenticatePlayer(ServerPlayerEntity player, Text msg) {
PlayerCache playerCache = deauthenticatedUsers.get(convertUuid(player));
// Teleporting player back // Teleporting player back
if(config.main.spawnOnJoin) if(config.main.spawnOnJoin)
teleportPlayer(player, false); teleportPlayer(player, false);
// Updating blocks if needed (if portal rescue action happened) // Updating blocks if needed (if portal rescue action happened)
if(deauthenticatedUsers.get(convertUuid(player)).wasInPortal) { if(playerCache.wasInPortal) {
World world = player.getEntityWorld(); World world = player.getEntityWorld();
BlockPos pos = player.getBlockPos(); BlockPos pos = player.getBlockPos();
@ -181,7 +182,7 @@ public class SimpleAuth implements DedicatedServerModInitializer {
// Setting last air to player // Setting last air to player
if(player.isSubmergedInWater()) if(player.isSubmergedInWater())
player.setAir(deauthenticatedUsers.get(convertUuid(player)).lastAir); player.setAir(playerCache.lastAir);
deauthenticatedUsers.remove(convertUuid(player)); deauthenticatedUsers.remove(convertUuid(player));

View File

@ -76,7 +76,7 @@ public class AuthEventHandler {
playerCache.validUntil >= System.currentTimeMillis() && playerCache.validUntil >= System.currentTimeMillis() &&
player.getIp().equals(playerCache.lastIp) player.getIp().equals(playerCache.lastIp)
) { ) {
deauthenticatedUsers.remove(uuid); // Makes player authenticated authenticatePlayer(player, null); // Makes player authenticated
return; return;
} }
// Invalidating session // Invalidating session