Update lang.yml

This commit is contained in:
ME1312 2021-04-03 23:59:51 -04:00
parent 23a434054f
commit 746c51e8fa
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
4 changed files with 21 additions and 19 deletions

View File

@ -355,15 +355,15 @@ public class ConfigUpdater {
def.put("Command.Generic.Console-Only", "&cSubServers &4&l\\u00BB&c This command is for console use only");
def.put("Command.Generic.Usage", "&7SubServers &8&l\\u00BB&7 Usage: &f$str$");
def.put("Command.Generic.Exception", "&cSubServers &4&l\\u00BB&c An unexpected exception has occurred while parsing this command");
def.put("Command.Generic.Invalid-Subcommand", "&cSubServers &4&l\\u00BB&c Unknown sub-command: $str$");
def.put("Command.Generic.Invalid-Subcommand", "&cSubServers &4&l\\u00BB&c Unknown sub-command: &4$str$");
def.put("Command.Generic.Invalid-Permission", "&cSubServers &4&l\\u00BB&c You need &4&n$str$&c to use this command");
def.put("Command.Generic.Invalid-Select-Permission", "&cSubServers &4&l\\u00BB&c You don't have permission to select &4$str$");
def.put("Command.Generic.Unknown-Proxy", "&cSubServers &4&l\\u00BB&c There is no proxy with name &4$str$");
def.put("Command.Generic.Unknown-Host", "&cSubServers &4&l\\u00BB&c There is no host with name &4$str$");
def.put("Command.Generic.Unknown-Group", "&cSubServers &4&l\\u00BB&c There is no group with name &4$str$");
def.put("Command.Generic.Unknown-Server", "&cSubServers &4&l\\u00BB&c There is no server with name &4$str$");
def.put("Command.Generic.Unknown-SubServer", "&cSubServers &4&l\\u00BB&c There is no subserver with name &4$str$");
def.put("Command.Generic.Unknown-Player", "&cSubServers &4&l\\u00BB&c There is no player with name &4$str$");
def.put("Command.Generic.Unknown-Proxy", "&cSubServers &4&l\\u00BB&c There is no proxy named &4$str$");
def.put("Command.Generic.Unknown-Host", "&cSubServers &4&l\\u00BB&c There is no host named &4$str$");
def.put("Command.Generic.Unknown-Group", "&cSubServers &4&l\\u00BB&c There is no group named &4$str$");
def.put("Command.Generic.Unknown-Server", "&cSubServers &4&l\\u00BB&c There is no server named &4$str$");
def.put("Command.Generic.Unknown-SubServer", "&cSubServers &4&l\\u00BB&c There is no subserver named &4$str$");
def.put("Command.Generic.Unknown-Player", "&cSubServers &4&l\\u00BB&c There is no player named &4$str$");
def.put("Command.Generic.No-Servers-On-Host", "&7SubServers &8&l\\u00BB&7 There are no servers on host &f$str$");
def.put("Command.Generic.No-SubServers-On-Host", "&7SubServers &8&l\\u00BB&7 There are no subservers on host &f$str$");
def.put("Command.Generic.No-Servers-In-Group", "&7SubServers &8&l\\u00BB&7 There are no servers in group &f$str$");
@ -392,7 +392,7 @@ public class ConfigUpdater {
def.put("Command.List.Header", "&7: ");
def.put("Command.List.Divider", "&7, ");
def.put("Command.List.Empty", "&7(none)");
def.put("Command.Info", "&7SubServers &8&l\\u00BB&7 Info on $str$&7: &r");
def.put("Command.Info", "&7SubServers &8&l\\u00BB&7 Info on $str$: &r");
def.put("Command.Info.Unknown", "&cSubServers &4&l\\u00BB&c There is no object with that name");
def.put("Command.Info.Unknown-Type", "&cSubServers &4&l\\u00BB&c There is no object type with that name");
def.put("Command.Info.Unknown-Proxy", "&cSubServers &4&l\\u00BB&c There is no proxy with that name");

View File

@ -787,7 +787,7 @@ public final class SubCommand extends BukkitCommand {
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Subcommand").replace("$str$", args[0]));
}
} else {
if (sender.hasPermission("subservers.interface") && sender instanceof Player && plugin.gui != null) {
if (plugin.gui != null && sender instanceof Player && sender.hasPermission("subservers.interface")) {
plugin.gui.getRenderer((Player) sender).newUI();
} else {
sender.sendMessage(printHelp(sender, label));
@ -795,7 +795,7 @@ public final class SubCommand extends BukkitCommand {
}
} else if (args.length > 0 && (args[0].equalsIgnoreCase("tp") || args[0].equalsIgnoreCase("teleport"))) {
executeTeleport(sender, label, args);
} else if (sender.hasPermission("subservers.interface") && sender instanceof Player) {
} else if (plugin.gui != null && sender instanceof Player && sender.hasPermission("subservers.interface")) {
plugin.gui.getRenderer((Player) sender).newUI();
} else {
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Permission").replace("$str$", "subservers.command"));

View File

@ -25,10 +25,9 @@ permissions:
subservers.command:
description: "Access to the SubServers Command"
default: op
children:
subservers.teleport:
description: "Access to SubServers' Teleport Command"
default: op
subservers.teleport:
description: "Access to SubServers' Teleport Command"
default: op
subservers.teleport-others:
description: "Access to Teleport other players using the Teleport Command"
default: op

View File

@ -65,7 +65,7 @@ public final class SubCommand implements CommandExecutor {
return CommandSpec.builder()
.description(Text.of("The SubServers Command"))
.executor(root)
.arguments(GenericArguments.optional(GenericArguments.string(Text.of("subcommand"))), GenericArguments.optional(GenericArguments.remainingJoinedStrings(Text.of("..."))))
.arguments(GenericArguments.optional(GenericArguments.string(Text.of("Command"))), GenericArguments.optional(GenericArguments.remainingJoinedStrings(Text.of("..."))))
.child(CommandSpec.builder()
.description(Text.of("The SubServers Command - Help"))
.executor(new HELP())
@ -150,18 +150,21 @@ public final class SubCommand implements CommandExecutor {
public CommandResult execute(CommandSource sender, CommandContext args) throws CommandException {
if (canRun(sender)) {
Optional<String> subcommand = args.getOne(Text.of("subcommand"));
Optional<String> subcommand = args.getOne(Text.of("Command"));
if (subcommand.isPresent()) {
sender.sendMessage(ChatColor.convertColor(plugin.api.getLang("SubServers","Command.Generic.Invalid-Subcommand").replace("$str$", subcommand.get())));
sender.sendMessage(ChatColor.convertColor(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Subcommand").replace("$str$", subcommand.get())));
return CommandResult.builder().successCount(0).build();
} else {
if (sender.hasPermission("subservers.interface") && sender instanceof Player && plugin.gui != null) {
if (plugin.gui != null && sender instanceof Player && sender.hasPermission("subservers.interface")) {
plugin.gui.getRenderer((Player) sender).newUI();
} else {
sender.sendMessages(printHelp());
}
return CommandResult.builder().successCount(1).build();
}
} else if (plugin.gui != null && sender instanceof Player && sender.hasPermission("subservers.interface")) {
plugin.gui.getRenderer((Player) sender).newUI();
return CommandResult.builder().successCount(1).build();
} else {
sender.sendMessage(ChatColor.convertColor(plugin.api.getLang("SubServers","Command.Generic.Invalid-Permission").replace("$str$", "subservers.command")));
return CommandResult.builder().successCount(0).build();
@ -1146,7 +1149,7 @@ public final class SubCommand implements CommandExecutor {
}
if (s.isPresent() && (p.isPresent() || sender instanceof Player)) {
if (sender.hasPermission("subservers.command") || sender.hasPermission("subservers.teleport")) {
if (sender.hasPermission("subservers.teleport")) {
String name = (p.isPresent())?p.get():null;
String select = s.get();
plugin.api.getServer(select, server -> {