mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 23:28:59 +01:00
update some Utils method
This commit is contained in:
parent
09067ddbd1
commit
d7f9b602c7
@ -162,8 +162,11 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
*
|
*
|
||||||
* @param event PlayerMoveEvent
|
* @param event PlayerMoveEvent
|
||||||
*/
|
*/
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
|
if (event.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
int radius = Settings.getMovementRadius;
|
int radius = Settings.getMovementRadius;
|
||||||
boolean allowMove = Settings.isMovementAllowed;
|
boolean allowMove = Settings.isMovementAllowed;
|
||||||
if (Settings.noTeleport) {
|
if (Settings.noTeleport) {
|
||||||
@ -187,12 +190,12 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
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 (!player.getWorld().equals(spawn.getWorld())) {
|
||||||
event.getPlayer().teleport(spawn);
|
player.teleport(spawn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((spawn.distance(player.getLocation()) > radius)) {
|
if ((spawn.distance(player.getLocation()) > radius)) {
|
||||||
event.getPlayer().teleport(spawn);
|
player.teleport(spawn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user