mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-10-31 07:39:42 +01:00
Fix noTeleport in the PlayerListener
This commit is contained in:
parent
cf475932fe
commit
614aa9d5e5
@ -166,24 +166,25 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
int radius = Settings.getMovementRadius;
|
int radius = Settings.getMovementRadius;
|
||||||
boolean allowMove = Settings.isMovementAllowed;
|
boolean allowMove = Settings.isMovementAllowed;
|
||||||
if (allowMove && radius <= 0)
|
if (Settings.noTeleport) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
if (allowMove && radius <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (Utils.checkAuth(player))
|
if (Utils.checkAuth(player)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!allowMove) {
|
if (!allowMove) {
|
||||||
if (event.getFrom().distance(event.getTo()) > 0) {
|
if (event.getFrom().distance(event.getTo()) > 0) {
|
||||||
event.setTo(event.getFrom());
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radius <= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Location spawn = plugin.getSpawnLocation(player);
|
Location spawn = plugin.getSpawnLocation(player);
|
||||||
if (spawn != null && spawn.getWorld() != null) {
|
if (spawn != null && spawn.getWorld() != null) {
|
||||||
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user