summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgravypod <gravypod@gravypod.com>2012-12-29 20:27:38 -0500
committergravypod <gravypod@gravypod.com>2012-12-29 20:27:38 -0500
commit2a3b5983e7c71503f3f9c0262e159e4462b5800d (patch)
treee1364e933eda64f619b37dcc2330ab08a09b5454
parent2c1414e7067070f9e3ff5a9d1c3b93572230c1d7 (diff)
downloadEssentials-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.java7
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);
}
}