mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 03:05:17 +01:00
Allow player falling, avoid useless lag and deny jumps! #618
This commit is contained in:
parent
4040cd9ba6
commit
4911499333
@ -172,9 +172,13 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Limit player X and Z movements to 1 block
|
||||
* Deny player Y+ movements (allows falling)
|
||||
*/
|
||||
if (event.getFrom().getBlockX() == event.getTo().getBlockX()
|
||||
&& event.getFrom().getBlockY() == event.getTo().getBlockY()
|
||||
&& event.getFrom().getBlockZ() == event.getTo().getBlockZ()) {
|
||||
&& event.getFrom().getBlockZ() == event.getTo().getBlockZ()
|
||||
&& event.getFrom().getY() - event.getTo().getY() >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -185,6 +189,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (!Settings.isMovementAllowed) {
|
||||
event.setTo(event.getFrom());
|
||||
// sgdc3 TODO: remove this, maybe we should set the effect every x ticks, idk!
|
||||
if (Settings.isRemoveSpeedEnabled) {
|
||||
player.setFlySpeed(0.0f);
|
||||
player.setWalkSpeed(0.0f);
|
||||
|
Loading…
Reference in New Issue
Block a user