added /region flag teleport

This commit is contained in:
Valentin Churavy 2011-02-24 21:35:45 +01:00
parent 68a0c67769
commit 92a03ab7d6

View File

@ -90,6 +90,30 @@ public boolean handle(CommandSender sender, String senderName, String command, S
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 if(nameStr.equals("teleport"))
{
if (valueStr.equals("set")){
player.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag teleport set to current location");
AreaFlags flags = region.getFlags();
Location l = player.getLocation();
flags.setFlag("teleport", "x", l.getX());
flags.setFlag("teleport", "y", l.getY());
flags.setFlag("teleport", "z", l.getZ());
flags.setFlag("teleport", "yaw", l.getYaw());
flags.setFlag("teleport", "pitch", l.getPitch());
flags.setFlag("teleport", "world", l.getWorld().getName());
}else if (valueStr.equals("delete")){
AreaFlags flags = region.getFlags();
flags.setFlag("spawn", "x", (String)null);
flags.setFlag("spawn", "y", (String)null);
flags.setFlag("spawn", "z", (String)null);
flags.setFlag("spawn", "yaw", (String)null);
flags.setFlag("spawn", "pitch", (String)null);
flags.setFlag("spawn", "world", (String)null);
player.sendMessage(ChatColor.YELLOW + "Region '" + id + "' updated. Flag teleport removed.");
}else{
player.sendMessage(ChatColor.RED + "Usage: /region flag <regionid> teleport <set|delete>");
}
} }
else else
{ {