summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-07-11 09:20:52 +0100
committerKHobbits <rob@khobbits.co.uk>2013-07-11 09:20:52 +0100
commitd8585552639220e8ad70c502cbe967333adc9e0b (patch)
treef5ca73c3c7f89bef4452aa86ed93ae0da366c5c8
parent72fd893733005a75f9809beb4d7943c39f955dc1 (diff)
downloadEssentials-d8585552639220e8ad70c502cbe967333adc9e0b.tar
Essentials-d8585552639220e8ad70c502cbe967333adc9e0b.tar.gz
Essentials-d8585552639220e8ad70c502cbe967333adc9e0b.tar.lz
Essentials-d8585552639220e8ad70c502cbe967333adc9e0b.tar.xz
Essentials-d8585552639220e8ad70c502cbe967333adc9e0b.zip
Don't cast sender to User.
-rw-r--r--Essentials/src/com/earth2me/essentials/SpawnMob.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java3
2 files changed, 3 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java
index f3f54d653..6038c7903 100644
--- a/Essentials/src/com/earth2me/essentials/SpawnMob.java
+++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java
@@ -206,7 +206,7 @@ public class SpawnMob
throw new Exception(_("disabledToSpawnMob"));
}
- if (sender instanceof User && !((User)sender).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase(Locale.ENGLISH)))
+ if (sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase(Locale.ENGLISH)))
{
throw new Exception(_("noPermToSpawnMob"));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
index dc04c0e04..33b69565f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
@@ -9,6 +9,7 @@ import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@@ -87,7 +88,7 @@ public class Commandpowertool extends EssentialsCommand
{
if (command.startsWith("a:"))
{
- if (sender instanceof User && !((User)sender).isAuthorized("essentials.powertool.append"))
+ if (sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.powertool.append"))
{
throw new Exception(_("noPerm", "essentials.powertool.append"));
}