Allows both any and all for selecting all worlds for permission targets

This commit is contained in:
Kristian Knarvik 2022-01-23 11:58:13 +01:00
parent 20622d3160
commit 495beb970c

View File

@ -61,7 +61,8 @@ public class CreateCommand implements CommandExecutor {
for (String permission : permissions) { for (String permission : permissions) {
if (permission.contains(":")) { if (permission.contains(":")) {
String world = permission.split(":")[0]; String world = permission.split(":")[0];
if (!world.equalsIgnoreCase("all") && Bukkit.getWorld(world) == null) { if (!world.equalsIgnoreCase("all") && !world.equalsIgnoreCase("any") &&
Bukkit.getWorld(world) == null) {
sender.sendMessage(StringFormatter.replacePlaceholder(StringFormatter.getTranslatedErrorMessage( sender.sendMessage(StringFormatter.replacePlaceholder(StringFormatter.getTranslatedErrorMessage(
TranslatableMessage.PERMISSION_WORLD_INVALID), "{world}", world)); TranslatableMessage.PERMISSION_WORLD_INVALID), "{world}", world));
return null; return null;