mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-26 11:07:55 +01:00
Correctly throw exceptions if mob spawn protection is on
This commit is contained in:
parent
c6e68f72ea
commit
f8450e39e3
@ -56,11 +56,6 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
if (ess.getSettings().getProtectPreventSpawn(mobType.toLowerCase())
|
||||
|| (mountType != null && ess.getSettings().getProtectPreventSpawn(mountType.toLowerCase())))
|
||||
{
|
||||
throw new Exception(Util.i18n("unableToSpawnMob"));
|
||||
}
|
||||
|
||||
Entity spawnedMob = null;
|
||||
Mob mob = null;
|
||||
@ -72,6 +67,12 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(Util.i18n("invalidMob"));
|
||||
}
|
||||
|
||||
if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase()))
|
||||
{
|
||||
throw new Exception(Util.i18n("unableToSpawnMob"));
|
||||
}
|
||||
|
||||
int[] ignore =
|
||||
{
|
||||
8, 9
|
||||
@ -102,6 +103,11 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
user.sendMessage(Util.i18n("invalidMob"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase()))
|
||||
{
|
||||
throw new Exception(Util.i18n("unableToSpawnMob"));
|
||||
}
|
||||
try
|
||||
{
|
||||
spawnedMount = mobMount.spawn(user, server, loc);
|
||||
|
Loading…
Reference in New Issue
Block a user