mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 10:37:41 +01:00
added /region flag teleport
This commit is contained in:
parent
68a0c67769
commit
92a03ab7d6
@ -90,6 +90,30 @@ public boolean handle(CommandSender sender, String senderName, String command, S
|
||||
flags.setFlag("spawn", "world", (String)null);
|
||||
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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user