diff options
author | gravypod <gravypod@gravypod.com> | 2012-12-29 20:27:38 -0500 |
---|---|---|
committer | gravypod <gravypod@gravypod.com> | 2012-12-29 20:27:38 -0500 |
commit | 2a3b5983e7c71503f3f9c0262e159e4462b5800d (patch) | |
tree | e1364e933eda64f619b37dcc2330ab08a09b5454 | |
parent | 2c1414e7067070f9e3ff5a9d1c3b93572230c1d7 (diff) | |
download | Essentials-2a3b5983e7c71503f3f9c0262e159e4462b5800d.tar Essentials-2a3b5983e7c71503f3f9c0262e159e4462b5800d.tar.gz Essentials-2a3b5983e7c71503f3f9c0262e159e4462b5800d.tar.lz Essentials-2a3b5983e7c71503f3f9c0262e159e4462b5800d.tar.xz Essentials-2a3b5983e7c71503f3f9c0262e159e4462b5800d.zip |
Create less objects, store a copy of player
-rw-r--r-- | Essentials/src/net/ess3/commands/Commandfly.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Essentials/src/net/ess3/commands/Commandfly.java b/Essentials/src/net/ess3/commands/Commandfly.java index 24581653d..5166a3c26 100644 --- a/Essentials/src/net/ess3/commands/Commandfly.java +++ b/Essentials/src/net/ess3/commands/Commandfly.java @@ -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); } } |