1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-05 14:18:21 +02:00

Add permission check before resetting speed on login The staff of my server asked me to do this fix, but I think it is very useful for all. This commit change is to reset player fly & run speed only if player has no permission to change speed.

This commit is contained in:
Alexander Likhachev
2014-07-13 21:52:51 +07:00
committed by KHobbits
parent 23f14bc2d5
commit ed56afda26

View File

@@ -331,8 +331,11 @@ public class EssentialsPlayerListener implements Listener
user.getBase().sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName())); user.getBase().sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
} }
} }
user.getBase().setFlySpeed(0.1f);
user.getBase().setWalkSpeed(0.2f); if (!user.isAuthorized("essentials.speed")) {
user.getBase().setFlySpeed(0.1f);
user.getBase().setWalkSpeed(0.2f);
}
user.stopTransaction(); user.stopTransaction();
} }