mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-04 22:41:33 +01:00
Don't cast sender to User.
This commit is contained in:
parent
72fd893733
commit
d858555263
@ -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"));
|
||||||
}
|
}
|
||||||
|
@ -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"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user