Don't cast sender to User.

This commit is contained in:
KHobbits 2013-07-11 09:20:52 +01:00
parent 72fd893733
commit d858555263
2 changed files with 3 additions and 2 deletions

View File

@ -206,7 +206,7 @@ public class SpawnMob
throw new Exception(_("disabledToSpawnMob")); 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")); throw new Exception(_("noPermToSpawnMob"));
} }

View File

@ -9,6 +9,7 @@ import java.util.Locale;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -87,7 +88,7 @@ public class Commandpowertool extends EssentialsCommand
{ {
if (command.startsWith("a:")) 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")); throw new Exception(_("noPerm", "essentials.powertool.append"));
} }