summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-10-16 20:59:39 +0100
committerKHobbits <rob@khobbits.co.uk>2013-10-16 21:05:33 +0100
commitff46b39f2b42abbe4ce8dc39e564f3dc71a2a104 (patch)
treed4438b241ea1b251105a2622aada79542c2f41ce /Essentials/src/com/earth2me/essentials/commands/Commandspeed.java
parentd6dfe5da65fdc9bda682615488f5dc9917c394b5 (diff)
downloadEssentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar.gz
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar.lz
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.tar.xz
Essentials-ff46b39f2b42abbe4ce8dc39e564f3dc71a2a104.zip
Extract CommandSender to CommandSource, this should prevent Ess user object leaks.
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandspeed.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspeed.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java b/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java
index f4bc6e597..ce361e786 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import java.util.List;
import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,7 +16,7 @@ public class Commandspeed extends EssentialsCommand
}
@Override
- protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
@@ -53,7 +53,7 @@ public class Commandspeed extends EssentialsCommand
{
throw new PlayerNotFoundException();
}
- speedOtherPlayers(server, user.getBase(), isFly, isBypass, speed, args[2]);
+ speedOtherPlayers(server, user.getSource(), isFly, isBypass, speed, args[2]);
return;
}
}
@@ -70,9 +70,9 @@ public class Commandspeed extends EssentialsCommand
}
}
- private void speedOtherPlayers(final Server server, final CommandSender sender, final boolean isFly, final boolean isBypass, final float speed, final String name) throws PlayerNotFoundException
+ private void speedOtherPlayers(final Server server, final CommandSource sender, final boolean isFly, final boolean isBypass, final float speed, final String name) throws PlayerNotFoundException
{
- boolean skipHidden = sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.vanish.interact");
+ boolean skipHidden = sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.vanish.interact");
boolean foundUser = false;
final List<Player> matchedPlayers = server.matchPlayer(name);
for (Player matchPlayer : matchedPlayers)