Skip to content

Commit

Permalink
Update lang.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Apr 4, 2021
1 parent 23a4340 commit 746c51e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
Expand Up @@ -355,15 +355,15 @@ public static void updateLang(File file) throws IOException {
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$");
Expand Down Expand Up @@ -392,7 +392,7 @@ public static void updateLang(File file) throws IOException {
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");
Expand Down
Expand Up @@ -787,15 +787,15 @@ public void run(ObjectMap<String> json) {
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));
}
}
} 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"));
Expand Down
7 changes: 3 additions & 4 deletions SubServers.Client/Bukkit/src/plugin.yml
Expand Up @@ -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
Expand Down
Expand Up @@ -65,7 +65,7 @@ public CommandSpec spec() {
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())
Expand Down Expand Up @@ -150,18 +150,21 @@ private boolean canRun(CommandSource sender, boolean permitted) throws CommandEx

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();
Expand Down Expand Up @@ -1146,7 +1149,7 @@ public CommandResult execute(CommandSource sender, CommandContext args) throws C
}

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 -> {
Expand Down

0 comments on commit 746c51e

Please sign in to comment.