mirror of
https://github.com/essentials/Essentials.git
synced 2025-02-25 00:42:48 +01:00
New permissions:
essentials.spawnmob.[mobname] and essentials.spawner.[mobname]
This commit is contained in:
parent
04b88cd0c4
commit
6db353bc6a
@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Mob;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
@ -43,6 +44,14 @@ public class Commandspawner extends EssentialsCommand
|
||||
user.sendMessage(_("invalidMob"));
|
||||
return;
|
||||
}
|
||||
if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
}
|
||||
if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase()))
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
}
|
||||
((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType());
|
||||
user.sendMessage(_("setSpawner", mob.name));
|
||||
}
|
||||
|
@ -66,6 +66,10 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
}
|
||||
if (!user.isAuthorized("essentials.spawnmob." + mob.name.toLowerCase()))
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
}
|
||||
|
||||
final Block block = Util.getTarget(user).getBlock();
|
||||
if (block == null)
|
||||
@ -96,6 +100,10 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
}
|
||||
if (!user.isAuthorized("essentials.spawnmob." + mobMount.name.toLowerCase()))
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
}
|
||||
try
|
||||
{
|
||||
spawnedMount = mobMount.spawn(user, server, loc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user