mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-19 07:07:55 +01:00
ignore yaw changes in player move event.
This commit is contained in:
parent
8e9bfc6299
commit
5be476e2d6
@ -164,15 +164,21 @@ public class AuthMePlayerListener implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerMove(PlayerMoveEvent event) {
|
||||
if (event.isCancelled())
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int radius = Settings.getMovementRadius;
|
||||
boolean allowMove = Settings.isMovementAllowed;
|
||||
if (Settings.noTeleport) {
|
||||
return;
|
||||
}
|
||||
if (allowMove && radius <= 0) {
|
||||
|
||||
if (Settings.isMovementAllowed && Settings.getMovementRadius <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getFrom().getBlockX() == event.getTo().getBlockX()
|
||||
&& event.getFrom().getBlockY() == event.getTo().getBlockY()
|
||||
&& event.getFrom().getBlockZ() == event.getTo().getBlockZ()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -181,9 +187,9 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!allowMove) {
|
||||
if (!Settings.isMovementAllowed) {
|
||||
if (event.getFrom().distance(event.getTo()) > 0) {
|
||||
event.setCancelled(true);
|
||||
event.setTo(event.getFrom());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -194,7 +200,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
player.teleport(spawn);
|
||||
return;
|
||||
}
|
||||
if ((spawn.distance(player.getLocation()) > radius)) {
|
||||
if ((spawn.distance(player.getLocation()) > Settings.getMovementRadius)) {
|
||||
player.teleport(spawn);
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,8 @@ public final class Utils {
|
||||
assert permsMan != null;
|
||||
|
||||
// Remove old groups
|
||||
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
|
||||
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup,
|
||||
Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
|
||||
|
||||
// Add the normal group, return the result
|
||||
return permsMan.addGroup(player, group);
|
||||
@ -185,13 +186,12 @@ public final class Utils {
|
||||
return true;
|
||||
}
|
||||
|
||||
String name = player.getName().toLowerCase();
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
if (PlayerCache.getInstance().isAuthenticated(player.getName())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
if (!plugin.database.isAuthAvailable(name)) {
|
||||
if (!plugin.database.isAuthAvailable(player.getName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user