1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-26 16:04:27 +02:00

Create less objects, store a copy of player

This commit is contained in:
gravypod
2012-12-29 20:27:38 -05:00
parent 2c1414e706
commit 2a3b5983e7

View File

@@ -10,10 +10,11 @@ public class Commandfly extends EssentialsToggleCommand
{
protected void setValue(final IUser player, final boolean value)
{
player.getPlayer().setAllowFlight(value);
if (!player.getPlayer().getAllowFlight())
final Player realPlayer = player.getPlayer();
realPlayer.setAllowFlight(value);
if (!realPlayer.getAllowFlight())
{
player.getPlayer().setFlying(false);
realPlayer.setFlying(false);
}
}