mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-27 10:01:34 +01:00
remove speed already done in join process
This commit is contained in:
parent
1af937651c
commit
6f1af92a58
@ -130,31 +130,27 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
if (Settings.isMovementAllowed && Settings.getMovementRadius <= 0)
|
int radius = Settings.getMovementRadius;
|
||||||
|
boolean allowMove = Settings.isMovementAllowed;
|
||||||
|
if (allowMove && radius <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (Utils.checkAuth(player))
|
if (Utils.checkAuth(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Settings.isMovementAllowed) {
|
if (!allowMove) {
|
||||||
if (event.getFrom().distance(event.getTo()) > 0) {
|
if (event.getFrom().distance(event.getTo()) > 0) {
|
||||||
if (Settings.isRemoveSpeedEnabled) {
|
|
||||||
player.setWalkSpeed(0.0f);
|
|
||||||
player.setFlySpeed(0.0f);
|
|
||||||
}
|
|
||||||
event.setTo(event.getFrom());
|
event.setTo(event.getFrom());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.getMovementRadius <= 0) {
|
if (radius <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int radius = Settings.getMovementRadius;
|
|
||||||
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())) {
|
||||||
event.getPlayer().teleport(spawn);
|
event.getPlayer().teleport(spawn);
|
||||||
|
Loading…
Reference in New Issue
Block a user