forked from sorceress/EasyAuth
Minor change
This commit is contained in:
parent
f522334305
commit
fa1557a577
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue