mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-28 03:09:14 +00:00
Added new command "setname" which allows to set the custom name with a console command.
This commit is contained in:
@@ -126,6 +126,20 @@ public class RPGRegionsCommand extends BaseCommand {
|
||||
plugin.getManagers().getRegionsCache().addConfiguredRegion(configuredRegion);
|
||||
}
|
||||
|
||||
@Subcommand("setname")
|
||||
@CommandPermission("rpgregions.setname")
|
||||
@CommandCompletion("@regions")
|
||||
public void onSetName(CommandSender sender, String region, String regionName) {
|
||||
Optional<ConfiguredRegion> configuredRegion = plugin.getManagers().getRegionsCache().getConfiguredRegion(region);
|
||||
if (configuredRegion.isEmpty()) {
|
||||
sender.sendMessage(StringUtils.colour("&cRegion '" + region + "' does not exist yet, create it first."));
|
||||
return;
|
||||
}
|
||||
configuredRegion.get().setCustomName(regionName);
|
||||
sender.sendMessage(StringUtils.colour("&aSet name of region '" + region + "' to: " + regionName));
|
||||
}
|
||||
|
||||
|
||||
@Subcommand("remove")
|
||||
@CommandPermission("rpgregions.remove")
|
||||
@CommandCompletion("@regions")
|
||||
|
||||
Reference in New Issue
Block a user