mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-29 11:49:08 +00:00
Add /rpgri setworld command
This commit is contained in:
@@ -11,7 +11,7 @@ import java.util.UUID;
|
||||
public abstract class RPGRegionsRegion {
|
||||
|
||||
private final String name;
|
||||
private final UUID world;
|
||||
private UUID world;
|
||||
private final List<Location> points;
|
||||
private int priority;
|
||||
|
||||
@@ -30,6 +30,10 @@ public abstract class RPGRegionsRegion {
|
||||
return world;
|
||||
}
|
||||
|
||||
public void setWorld(UUID world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
@@ -119,4 +119,16 @@ public class RPGRegionsIntegrationCommand extends BaseCommand {
|
||||
region.setPriority(priority);
|
||||
player.sendMessage(ChatColor.GREEN + "Set priority of " + region.getName() + " to " + priority + ".");
|
||||
}
|
||||
|
||||
@Subcommand("setworld")
|
||||
@CommandCompletion("@regions @worlds")
|
||||
public void onSetWorld(final CommandSender sender, final RPGRegionsRegion region, final String worldName) {
|
||||
final World world = Bukkit.getWorld(worldName);
|
||||
if (world == null) {
|
||||
sender.sendMessage(ChatColor.RED + "That world could not be found.");
|
||||
return;
|
||||
}
|
||||
region.setWorld(world.getUID());
|
||||
sender.sendMessage(ChatColor.GREEN + "Set region '" + region.getName() + "' world to '" + world.getName() + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user