Fixing #12
This commit is contained in:
parent
eed619cbb0
commit
14fcda580e
|
@ -114,7 +114,6 @@ public class AuthEventHandler {
|
||||||
|
|
||||||
// Teleporting player to the middle of the block
|
// Teleporting player to the middle of the block
|
||||||
player.teleport(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
|
player.teleport(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
|
||||||
playerCache.wasInPortal = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +153,17 @@ public class AuthEventHandler {
|
||||||
|
|
||||||
// Player movement
|
// Player movement
|
||||||
public static ActionResult onPlayerMove(PlayerEntity player) {
|
public static ActionResult onPlayerMove(PlayerEntity player) {
|
||||||
if(!isAuthenticated((ServerPlayerEntity) player) && !config.experimental.allowMovement) {
|
// Player will fall if enabled (prevent fly kick)
|
||||||
|
boolean auth = isAuthenticated((ServerPlayerEntity) player);
|
||||||
|
if(!auth && config.main.allowFalling && !player.isOnGround() && !player.isInsideWaterOrBubbleColumn()) {
|
||||||
|
if(player.isInvulnerable())
|
||||||
|
player.setInvulnerable(false);
|
||||||
|
return ActionResult.PASS;
|
||||||
|
}
|
||||||
|
// Otherwise movement should be disabled
|
||||||
|
else if(!auth && !config.experimental.allowMovement) {
|
||||||
|
if(!player.isInvulnerable())
|
||||||
|
player.setInvulnerable(true);
|
||||||
return ActionResult.FAIL;
|
return ActionResult.FAIL;
|
||||||
}
|
}
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
|
|
|
@ -53,8 +53,13 @@ public class AuthConfig {
|
||||||
// Visit https://github.com/samolego/SimpleAuth/wiki/Sessions for more info
|
// Visit https://github.com/samolego/SimpleAuth/wiki/Sessions for more info
|
||||||
public int sessionTimeoutTime = 60;
|
public int sessionTimeoutTime = 60;
|
||||||
|
|
||||||
|
// Should deauthenticated players fall if the login mid-air?
|
||||||
|
public boolean allowFalling = false;
|
||||||
|
|
||||||
// Whether to tp player to spawn when joining (to hide coordinates)
|
// Whether to tp player to spawn when joining (to hide coordinates)
|
||||||
public boolean spawnOnJoin = false;
|
public boolean spawnOnJoin = false;
|
||||||
|
|
||||||
|
// Data for spawn (where deauthenticated players are teleported)
|
||||||
public static class WorldSpawn {
|
public static class WorldSpawn {
|
||||||
public String dimension;
|
public String dimension;
|
||||||
public double x;
|
public double x;
|
||||||
|
|
Loading…
Reference in New Issue