mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-16 03:24:31 +02:00
Don't cast sender to User.
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
@@ -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"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user