/tpr <id> spawn does now need the permissions /tpregion.spawn and also

added /region flag <id> spawn delete
This commit is contained in:
Valentin Churavy 2011-02-24 23:04:50 +01:00
parent 3a10a0969a
commit 933987ac0a
2 changed files with 4 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public boolean handle(CommandSender sender, String senderName, String command, S
}else{ }else{
player.sendMessage(ChatColor.RED + "You must set the spawn location inside the region it belongs to."); player.sendMessage(ChatColor.RED + "You must set the spawn location inside the region it belongs to.");
} }
} else { } else if (nameStr.equals("delete")){
AreaFlags flags = region.getFlags(); AreaFlags flags = region.getFlags();
flags.setFlag("spawn", "x", (String)null); flags.setFlag("spawn", "x", (String)null);
flags.setFlag("spawn", "y", (String)null); flags.setFlag("spawn", "y", (String)null);
@ -94,6 +94,8 @@ public boolean handle(CommandSender sender, String senderName, String command, S
flags.setFlag("spawn", "pitch", (String)null); flags.setFlag("spawn", "pitch", (String)null);
flags.setFlag("spawn", "world", (String)null); flags.setFlag("spawn", "world", (String)null);
player.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag spawn removed."); player.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag spawn removed.");
}else{
player.sendMessage(ChatColor.RED + "Usage: /region flag <regionid> spawn <set|delete>");
} }
}else if(nameStr.equals("teleport")) }else if(nameStr.equals("teleport"))
{ {

View File

@ -41,7 +41,7 @@ public boolean handle(CommandSender sender, String senderName,
String id = args[0]; String id = args[0];
Boolean spawn = false; Boolean spawn = false;
if(args.length==2 && args[1].equals("spawn")){ if(args.length==2 && args[1].equals("spawn")){
ch.checkPermission(player, "spawn"); ch.checkPermission(player, "/tpregion.spawn");
spawn = true; spawn = true;
} }
RegionManager mgr = wg.getGlobalRegionManager().getRegionManager(player.getWorld().getName()); RegionManager mgr = wg.getGlobalRegionManager().getRegionManager(player.getWorld().getName());