From 9aed0f58955a61357aac7954eefd82d4645ecdff Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Fri, 8 Jul 2022 19:06:12 +0200 Subject: [PATCH] 1.1.0_Snapshot-#1 --- pom.xml | 3 +- .../alias/Spigot/cmdManagement/Commands.java | 1 - .../Spigot/cmdManagement/ExecuteAlias.java | 185 ++++++++++++------ .../cmdManagement/RegisterCommands.java | 27 ++- .../config/alias/AliasConfigConverter.java | 24 ++- .../alias/CreateExampleAliasConfig.java | 12 +- .../Spigot/config/alias/SelectAlias.java | 32 ++- .../alias/Spigot/config/languages/MSG.java | 24 +-- .../config/languages/SelectMessages.java | 3 + .../subAlias/CreateExampleSubAliasConfig.java | 12 +- .../config/subAlias/SelectSubAlias.java | 35 +++- .../alias/Spigot/objects/AliasObject.java | 8 +- .../alias/Spigot/objects/SubAliasObject.java | 6 + src/main/java/net/t2code/alias/Util.java | 4 + .../resources/Alias/X_aliasDeclaration_X.yml | 70 +++++-- .../SubAlias/X_subAliasDeclaration_X.yml | 65 ++++-- 16 files changed, 376 insertions(+), 135 deletions(-) diff --git a/pom.xml b/pom.xml index 5d30bc4..e6de707 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.t2code Alias - 1.1.0_DEV + 1.1.0_Snapshot-#1 jar T2C-Alias @@ -70,7 +70,6 @@ net.t2code T2CodeLib 12.4 - dev-1 net.t2code diff --git a/src/main/java/net/t2code/alias/Spigot/cmdManagement/Commands.java b/src/main/java/net/t2code/alias/Spigot/cmdManagement/Commands.java index b7eb672..decb4bc 100644 --- a/src/main/java/net/t2code/alias/Spigot/cmdManagement/Commands.java +++ b/src/main/java/net/t2code/alias/Spigot/cmdManagement/Commands.java @@ -22,7 +22,6 @@ public class Commands { send.console(Util.getPrefix() + "§8-------------------------------"); send.console(Util.getPrefix() + " §6Plugin reload..."); send.console(Util.getPrefix() + "§8-------------------------------"); - Load.loadReload(); Main.getPlugin().onEnable(); if (sender instanceof Player) sender.sendMessage(SelectMessages.reloadEnd); send.console(Util.getPrefix() + "§8-------------------------------"); diff --git a/src/main/java/net/t2code/alias/Spigot/cmdManagement/ExecuteAlias.java b/src/main/java/net/t2code/alias/Spigot/cmdManagement/ExecuteAlias.java index 0fd753a..fb362bf 100644 --- a/src/main/java/net/t2code/alias/Spigot/cmdManagement/ExecuteAlias.java +++ b/src/main/java/net/t2code/alias/Spigot/cmdManagement/ExecuteAlias.java @@ -1,5 +1,6 @@ package net.t2code.alias.Spigot.cmdManagement; +import net.t2code.alias.Spigot.Main; import net.t2code.alias.Spigot.config.config.SelectConfig; import net.t2code.alias.Spigot.config.languages.SelectMessages; import net.t2code.alias.Spigot.objects.AliasObject; @@ -14,28 +15,36 @@ import net.t2code.lib.Spigot.Lib.replace.Replace; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + public class ExecuteAlias { private static final String prefix = Util.getPrefix(); - protected static void aliasPlayer(CommandSender sender, AliasObject aliasObject, String alias) { + protected static void aliasPlayer(CommandSender sender, AliasObject aliasObject, String alias, String[] args) { Player player = (Player) sender; if (aliasObject.adminEnable) { if (player.hasPermission(aliasObject.adminPermission)) { if (aliasObject.adminCommandEnable) { - aliasAdminCommand(aliasObject, player); + aliasAdminCommand(aliasObject, player, args); } if (aliasObject.adminMessageEnable) { - aliasAdminMessage(aliasObject, player); + aliasAdminMessage(aliasObject, alias, player, args); } return; } } if (aliasObject.permNecessary) { - if (!(player.hasPermission("t2code.alias.use." + alias.toLowerCase()) || player.hasPermission("t2code.alias.admin"))) { - send.player(player, SelectMessages.noPermissionForCommand.replace("[cmd]", "/" + alias.toLowerCase()) - .replace("[perm]", "t2code.alias.use." + alias.toLowerCase())); + if (!(player.hasPermission(aliasObject.permission.replace("", alias.toLowerCase())) || player.hasPermission("t2code.alias.admin"))) { + String npmsg; + if (aliasObject.permissionMSG == null || aliasObject.permissionMSG.equals("")) { + npmsg = SelectMessages.noPermissionForCommand; + } else npmsg = aliasObject.permissionMSG; + send.player(player, npmsg.replace("[cmd]", "/" + alias.toLowerCase()) + .replace("[perm]", aliasObject.permission.replace("", alias.toLowerCase())).replace("[alias]", alias)); return; } } @@ -49,14 +58,14 @@ public class ExecuteAlias { } } if (aliasObject.commandEnable) { - aliasCommand(aliasObject, player); + aliasCommand(aliasObject, player, args); } if (aliasObject.messageEnable) { - aliasMessage(aliasObject, player); + aliasMessage(aliasObject, alias, player, args); } } - protected static void subAliasPlayer(CommandSender sender, SubAliasObject aliasObject, String alias) { + protected static void subAliasPlayer(CommandSender sender, SubAliasObject aliasObject, String alias, String[] args) { if (!aliasObject.subAliasEnable) { send.sender(sender, SelectMessages.aliasDisabled); return; @@ -68,19 +77,23 @@ public class ExecuteAlias { if (aliasObject.adminEnable) { if (player.hasPermission(aliasObject.adminPermission)) { if (aliasObject.adminCommandEnable) { - subAliasAdminCommand(aliasObject, player); + subAliasAdminCommand(aliasObject, player, args); } if (aliasObject.adminMessageEnable) { - subAliasAdminMessage(aliasObject, player); + subAliasAdminMessage(aliasObject, alias, player, args); } return; } } if (aliasObject.permNecessary) { - if (!(player.hasPermission("t2code.alias.use.subalias." + alias.toLowerCase()) || player.hasPermission("t2code.alias.admin"))) { - send.player(player, SelectMessages.noPermissionForCommand.replace("[cmd]", "/" + alias.toLowerCase()) - .replace("[perm]", "t2code.alias.subalias.use." + alias.toLowerCase())); + if (!(player.hasPermission(aliasObject.permission.replace("", alias.toLowerCase())) || player.hasPermission("t2code.alias.admin"))) { + String npmsg; + if (aliasObject.permissionMSG == null || aliasObject.permissionMSG.equals("")) { + npmsg = SelectMessages.noPermissionForCommand; + } else npmsg = aliasObject.permissionMSG; + send.player(player, npmsg.replace("[cmd]", "/" + alias.toLowerCase()) + .replace("[perm]", aliasObject.permission.replace("", alias.toLowerCase())).replace("[alias]", alias)); return; } } @@ -94,14 +107,14 @@ public class ExecuteAlias { } } if (aliasObject.commandEnable) { - subAliasCommand(aliasObject, player); + subAliasCommand(aliasObject, player, args); } if (aliasObject.messageEnable) { - subAliasMessage(aliasObject, player); + subAliasMessage(aliasObject, alias, player, args); } } else { if (aliasObject.consoleEnable) { - subAliasConsole(aliasObject, sender); + subAliasConsole(aliasObject, sender, args); } else send.sender(sender, SelectMessages.onlyForPlayer); } } @@ -128,18 +141,25 @@ public class ExecuteAlias { } } - private static void subAliasConsole(SubAliasObject alias, CommandSender sender) { + private static void subAliasConsole(SubAliasObject alias, CommandSender sender, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } if (alias.consoleCommandEnable) { for (String cmd : alias.consoleCommands) { if (alias.consoleBungeeCommand) { if (SelectConfig.Bungee) { - BCommandSenderReciver.sendToBungee(sender, cmd, true); + BCommandSenderReciver.sendToBungee(sender, cmd.replace("[target]", targetSt), true); } else { send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); send.sender(sender, Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); } } else { - Cmd.console(cmd); + Cmd.console(cmd.replace("[target]", targetSt)); } } } @@ -150,11 +170,18 @@ public class ExecuteAlias { } } - private static void aliasAdminCommand(AliasObject alias, Player player) { + private static void aliasAdminCommand(AliasObject alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } for (String cmd : alias.adminCommands) { if (alias.adminBungeeCommand) { if (SelectConfig.Bungee) { - BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()), alias.adminCommandAsConsole); + BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.adminCommandAsConsole); } else { send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); @@ -162,19 +189,26 @@ public class ExecuteAlias { } } else { if (alias.adminCommandAsConsole) { - Cmd.console(cmd.replace("[player]", player.getName())); + Cmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } else { - Cmd.player(player, cmd.replace("[player]", player.getName())); + Cmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } } } } - private static void subAliasAdminCommand(SubAliasObject alias, Player player) { + private static void subAliasAdminCommand(SubAliasObject alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } for (String cmd : alias.adminCommands) { if (alias.adminBungeeCommand) { if (SelectConfig.Bungee) { - BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()), alias.adminCommandAsConsole); + BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.adminCommandAsConsole); } else { send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); @@ -182,45 +216,64 @@ public class ExecuteAlias { } } else { if (alias.adminCommandAsConsole) { - Cmd.console(cmd.replace("[player]", player.getName())); + Cmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } else { - Cmd.player(player, cmd.replace("[player]", player.getName())); + Cmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } } } } - private static void aliasAdminMessage(AliasObject alias, Player player) { - for (String msg : alias.adminMessages) { + private static void aliasAdminMessage(AliasObject aliasObject, String alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } + for (String msg : aliasObject.adminMessages) { String text; - String hover; if (PluginCheck.papi()) { - text = Replace.replace(prefix, player, replacePlayer(msg, player)); + text = Replace.replace(prefix, player, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } else { - text = Replace.replace(prefix, replacePlayer(msg, player)); + text = Replace.replace(prefix, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } send.player(player, text); } } - private static void subAliasAdminMessage(SubAliasObject alias, Player player) { - for (String msg : alias.adminMessages) { + private static void subAliasAdminMessage(SubAliasObject subAliasObject, String alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } + for (String msg : subAliasObject.adminMessages) { String text; - String hover; if (PluginCheck.papi()) { - text = Replace.replace(prefix, player, replacePlayer(msg, player)); + text = Replace.replace(prefix, player, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } else { - text = Replace.replace(prefix, replacePlayer(msg, player)); + text = Replace.replace(prefix, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } send.player(player, text); } } - private static void aliasCommand(AliasObject alias, Player player) { + private static void aliasCommand(AliasObject alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } for (String cmd : alias.command) { if (alias.bungeeCommand) { if (SelectConfig.Bungee) { - BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()), alias.commandAsConsole); + BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.commandAsConsole); } else { send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); @@ -228,19 +281,26 @@ public class ExecuteAlias { } } else { if (alias.commandAsConsole) { - Cmd.console(cmd.replace("[player]", player.getName())); + Cmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } else { - Cmd.player(player, cmd.replace("[player]", player.getName())); + Cmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } } } } - private static void subAliasCommand(SubAliasObject alias, Player player) { + private static void subAliasCommand(SubAliasObject alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } for (String cmd : alias.command) { if (alias.bungeeCommand) { if (SelectConfig.Bungee) { - BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()), alias.commandAsConsole); + BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.commandAsConsole); } else { send.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); @@ -248,34 +308,49 @@ public class ExecuteAlias { } } else { if (alias.commandAsConsole) { - Cmd.console(cmd.replace("[player]", player.getName())); + Cmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } else { - Cmd.player(player, cmd.replace("[player]", player.getName())); + Cmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); } } } } - private static void aliasMessage(AliasObject alias, Player player) { - for (String msg : alias.messages) { + private static void aliasMessage(AliasObject aliasObject, String alias, Player player, String[] args) { + + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } + + for (String msg : aliasObject.messages) { String text; if (PluginCheck.papi()) { - text = Replace.replace(prefix, player, replacePlayer(msg, player)); + text = Replace.replace(prefix, player, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } else { - text = Replace.replace(prefix, replacePlayer(msg, player)); + text = Replace.replace(prefix, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } send.player(player, text); } } - private static void subAliasMessage(SubAliasObject alias, Player player) { - for (String msg : alias.messages) { + private static void subAliasMessage(SubAliasObject subAliasObject, String alias, Player player, String[] args) { + String targetSt = "[target]"; + try { + List results = Arrays.stream(args).filter(a -> a.contains("-p:")).collect(Collectors.toList()); + targetSt = results.get(0).replace("-p:", ""); + } catch (Exception ignored) { + + } + for (String msg : subAliasObject.messages) { String text; - String hover; if (PluginCheck.papi()) { - text = Replace.replace(prefix, player, replacePlayer(msg, player)); + text = Replace.replace(prefix, player, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } else { - text = Replace.replace(prefix, replacePlayer(msg, player)); + text = Replace.replace(prefix, replacePlayer(msg, player)).replace("[target]", targetSt).replace("[alias]", alias); } send.player(player, text); } diff --git a/src/main/java/net/t2code/alias/Spigot/cmdManagement/RegisterCommands.java b/src/main/java/net/t2code/alias/Spigot/cmdManagement/RegisterCommands.java index 88cc6c0..65f0b03 100644 --- a/src/main/java/net/t2code/alias/Spigot/cmdManagement/RegisterCommands.java +++ b/src/main/java/net/t2code/alias/Spigot/cmdManagement/RegisterCommands.java @@ -7,10 +7,17 @@ import net.t2code.alias.Spigot.objects.SubAliasObject; import net.t2code.alias.Util; import net.t2code.lib.Spigot.Lib.messages.send; import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; -public class RegisterCommands extends Command { +import java.lang.reflect.Array; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class RegisterCommands extends Command implements TabCompleter { private String alias; private String prefix = Util.getPrefix(); @@ -31,28 +38,38 @@ public class RegisterCommands extends Command { send.sender(sender, SelectMessages.aliasDisabled); return true; } - if (args.length == 0) { + if (args.length == 0 || args.length == 1 && args[0].contains("-p:")) { if (sender instanceof Player) { - ExecuteAlias.aliasPlayer(sender, alias, this.alias); + ExecuteAlias.aliasPlayer(sender, alias, this.alias, args); } else { if (alias.consoleEnable) { ExecuteAlias.aliasConsole(alias, sender, prefix); } else send.sender(sender, SelectMessages.onlyForPlayer); } } else { - if (!Main.allForSubAliases.contains(this.alias)) return false; + if (!Main.allForSubAliases.contains(this.alias)) { + return false; + } for (String sals : Main.allSubAliases) { SubAliasObject sal = Main.subAliasHashMap.get(sals); if (args.length == sal.subAliasArg + 1) { for (String al : sal.subAliasList) { if (args[sal.subAliasArg].toLowerCase().equals(al)) { - ExecuteAlias.subAliasPlayer(sender, sal, al); + ExecuteAlias.subAliasPlayer(sender, sal, al, args); + return true; } } } } + send.sender(sender, "TODO DEV'>Diesen Befehl gibt es nicht"); + //todo } return true; } + + @Override + public List onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) { + return Collections.singletonList("hallodepp"); + } } diff --git a/src/main/java/net/t2code/alias/Spigot/config/alias/AliasConfigConverter.java b/src/main/java/net/t2code/alias/Spigot/config/alias/AliasConfigConverter.java index b457e8a..44f020c 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/alias/AliasConfigConverter.java +++ b/src/main/java/net/t2code/alias/Spigot/config/alias/AliasConfigConverter.java @@ -23,7 +23,7 @@ public class AliasConfigConverter { } catch (IOException e) { e.printStackTrace(); } - + send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); send.error(Main.getPlugin(), ""); send.warning(Main.getPlugin(), "The " + config_gui.getName() + " file is converted to the new config format."); @@ -33,4 +33,26 @@ public class AliasConfigConverter { send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } + + public static void convertAddPermission(YamlConfiguration yamlConfiguration, File config_gui, Boolean subalias) { + if (subalias) { + yamlConfiguration.set("Alias.Permission.Permission", "t2code.alias.use."); + } else yamlConfiguration.set("SubAlias.Permission.Permission", "t2code.alias.use.subalias."); + try { + yamlConfiguration.save(config_gui); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void convertAddPermissionMSG(YamlConfiguration yamlConfiguration, File config_gui, Boolean subalias) { + if (subalias) { + yamlConfiguration.set("Alias.Permission.CustomNoPermissionMSG", ""); + } else yamlConfiguration.set("SubAlias.Permission.CustomNoPermissionMSG", ""); + try { + yamlConfiguration.save(config_gui); + } catch (IOException e) { + e.printStackTrace(); + } + } } diff --git a/src/main/java/net/t2code/alias/Spigot/config/alias/CreateExampleAliasConfig.java b/src/main/java/net/t2code/alias/Spigot/config/alias/CreateExampleAliasConfig.java index ce4d7a1..8d12614 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/alias/CreateExampleAliasConfig.java +++ b/src/main/java/net/t2code/alias/Spigot/config/alias/CreateExampleAliasConfig.java @@ -24,6 +24,8 @@ public class CreateExampleAliasConfig { Config.set("Alias.AliasList", Arrays.asList("aliasexample1"),yamlConfiguration); Config.set("Alias.Permission.Necessary", true, yamlConfiguration); + Config.set("Alias.Permission.Permission", "t2code.alias.use.", yamlConfiguration); + Config.set("Alias.Permission.CustomNoPermissionMSG", "", yamlConfiguration); Config.set("Alias.Cost.Enable", false,yamlConfiguration); Config.set("Alias.Cost.Price", 0.0,yamlConfiguration); @@ -36,11 +38,6 @@ public class CreateExampleAliasConfig { Config.set("Alias.Message.Enable", false, yamlConfiguration); Config.set("Alias.Message.Messages", Collections.emptyList(), yamlConfiguration); - Config.set("Alias.Message.TextBuilder.Enable", false, yamlConfiguration); - Config.set("Alias.Message.TextBuilder.Hover", "", yamlConfiguration); - Config.set("Alias.Message.TextBuilder.ClickEvent.Enable", false, yamlConfiguration); - Config.set("Alias.Message.TextBuilder.ClickEvent.Action", "", yamlConfiguration); - Config.set("Alias.Message.TextBuilder.ClickEvent.ActionValue", "", yamlConfiguration); Config.set("Alias.Admin.Enable", true, yamlConfiguration); Config.set("Alias.Admin.Permission", "t2code.alias.admin", yamlConfiguration); @@ -52,11 +49,6 @@ public class CreateExampleAliasConfig { Config.set("Alias.Admin.Message.Enable", false, yamlConfiguration); Config.set("Alias.Admin.Message.Messages", Collections.emptyList(), yamlConfiguration); - Config.set("Alias.Admin.Message.TextBuilder.Enable", false, yamlConfiguration); - Config.set("Alias.Admin.Message.TextBuilder.Hover", "", yamlConfiguration); - Config.set("Alias.Admin.Message.TextBuilder.ClickEvent.Enable", false, yamlConfiguration); - Config.set("Alias.Admin.Message.TextBuilder.ClickEvent.Action", "", yamlConfiguration); - Config.set("Alias.Admin.Message.TextBuilder.ClickEvent.ActionValue", "", yamlConfiguration); Config.set("Alias.Console.Enable", false, yamlConfiguration); Config.set("Alias.Console.Command.Enable", false, yamlConfiguration); diff --git a/src/main/java/net/t2code/alias/Spigot/config/alias/SelectAlias.java b/src/main/java/net/t2code/alias/Spigot/config/alias/SelectAlias.java index 4eb8794..0ecaa61 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/alias/SelectAlias.java +++ b/src/main/java/net/t2code/alias/Spigot/config/alias/SelectAlias.java @@ -1,17 +1,21 @@ package net.t2code.alias.Spigot.config.alias; +import com.google.common.base.Preconditions; import net.t2code.alias.Spigot.Main; import net.t2code.alias.Spigot.config.config.SelectConfig; import net.t2code.alias.Spigot.system.AliasRegister; import net.t2code.alias.Spigot.objects.AliasObject; import net.t2code.alias.Util; import net.t2code.lib.Spigot.Lib.messages.send; +import org.bukkit.Bukkit; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; +import java.util.logging.Level; public class SelectAlias { private static String Prefix = Util.getPrefix(); @@ -26,21 +30,37 @@ public class SelectAlias { if (config_gui.getName().equals("X_aliasDeclaration_X.yml")) continue; String sub = config_gui.getName().substring(config_gui.getName().length() - 4); - YamlConfiguration yamlConfiguration; if (sub.equals(".yml")) { + YamlConfiguration yamlConfiguration; try { - yamlConfiguration = YamlConfiguration.loadConfiguration(config_gui); - - } catch (Exception ex) { + Preconditions.checkArgument(config_gui != null, "File cannot be null"); + YamlConfiguration config = new YamlConfiguration(); + config.load(config_gui); + yamlConfiguration = config; + } catch (FileNotFoundException var3) { + continue; + } catch (IOException var4) { + Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + config_gui, var4); + continue; + } catch (InvalidConfigurationException var5) { + Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + config_gui, var5); continue; } Boolean aliasEnable = yamlConfiguration.getBoolean("Alias.Enable"); List aliasList; - if (SelectConfig.isConfigVersion < 3 && yamlConfiguration.get("Alias.AliasList") == null) { + if (yamlConfiguration.get("Alias.AliasList") == null) { AliasConfigConverter.convertAliasList(yamlConfiguration, config_gui); } aliasList = yamlConfiguration.getStringList("Alias.AliasList"); Boolean permNecessary = yamlConfiguration.getBoolean("Alias.Permission.Necessary"); + if (yamlConfiguration.get("Alias.Permission.Permission") == null) { + AliasConfigConverter.convertAddPermission(yamlConfiguration, config_gui, false); + } + String permission = yamlConfiguration.getString("Alias.Permission.Permission"); + if (yamlConfiguration.get("Alias.Permission.CustomNoPermissionMSG") == null) { + AliasConfigConverter.convertAddPermissionMSG(yamlConfiguration, config_gui, false); + } + String permissionMSG = yamlConfiguration.getString("Alias.Permission.CustomNoPermissionMSG"); Boolean costEnable = yamlConfiguration.getBoolean("Alias.Cost.Enable"); Double costPrice = yamlConfiguration.getDouble("Alias.Cost.Price"); @@ -73,7 +93,7 @@ public class SelectAlias { List consoleMessages = yamlConfiguration.getStringList("Alias.Console.Message.Messages"); Main.allAliases.addAll(aliasList); - AliasObject alias = new AliasObject(aliasEnable, aliasList, permNecessary, costEnable, costPrice, costAllowBypass, commandEnable, commandAsConsole, bungeeCommand, + AliasObject alias = new AliasObject(aliasEnable, aliasList, permNecessary, permission, permissionMSG, costEnable, costPrice, costAllowBypass, commandEnable, commandAsConsole, bungeeCommand, command, messageEnable, messages, adminEnable, adminPermission, adminCommandEnable, adminCommandAsConsole, adminBungeeCommand, adminCommands, adminMessageEnable, adminMessages, consoleEnable, consoleCommandEnable, consoleBungeeCommand, consoleCommands, consoleMessageEnable, consoleMessages); for (String al : aliasList) { diff --git a/src/main/java/net/t2code/alias/Spigot/config/languages/MSG.java b/src/main/java/net/t2code/alias/Spigot/config/languages/MSG.java index 5e838fc..4f53d5d 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/languages/MSG.java +++ b/src/main/java/net/t2code/alias/Spigot/config/languages/MSG.java @@ -15,30 +15,30 @@ public class MSG { // EN - public static String EN_OnlyForPlayer = "[prefix] &cThis command is for players only!"; + public static String EN_OnlyForPlayer = "[prefix] This command is for players only!"; public static String EN_Disabled = "Unknown command. Type ''/help'' for help."; - public static String EN_ReloadStart = "[prefix] &6Plugin is reloaded..."; - public static String EN_ReloadEnd = "[prefix] &2Plugin was successfully reloaded."; + public static String EN_ReloadStart = "[prefix] Plugin is reloaded..."; + public static String EN_ReloadEnd = "[prefix] Plugin was successfully reloaded."; - public static String EN_NoPermissionForCommand = "[prefix] &cFor &b[cmd] &cyou lack the permission &6[perm]&c!"; + public static String EN_NoPermissionForCommand = "[prefix] For [cmd] you lack the permission [perm]!"; - public static String EN_Buy = "[prefix] &2You have paid &6[price] &2for this command.&2."; - public static String EN_NoMoney = "[prefix] &cYou don't have enough money for this command!"; + public static String EN_Buy = "[prefix] You have paid [price] for this command."; + public static String EN_NoMoney = "[prefix] You don't have enough money for this command!"; // DE - public static String DE_OnlyForPlayer = "[prefix] &cDieser Command ist nur f[ue]r Spieler!"; + public static String DE_OnlyForPlayer = "[prefix] Dieser Command ist nur f[ue]r Spieler!"; public static String DE_Disabled = "Unknown command. Type ''/help'' for help."; - public static String DE_ReloadStart = "[prefix] &6Plugin wird neu geladen..."; - public static String DE_ReloadEnd = "[prefix] &2Plugin wurde erfolgreich neu geladen."; + public static String DE_ReloadStart = "[prefix] Plugin wird neu geladen..."; + public static String DE_ReloadEnd = "[prefix] Plugin wurde erfolgreich neu geladen."; - public static String DE_NoPermissionForCommand = "[prefix] &cF[ue]r &b[cmd] &cfehlt dir die Permission &6[perm]&c!"; + public static String DE_NoPermissionForCommand = "[prefix] F[ue]r [cmd] fehlt dir die Permission [perm]!"; - public static String DE_Buy = "[prefix] &2Du hast f[ue]r diesen Command &6[price] &2bezahlt."; - public static String DE_NoMoney = "[prefix] &cDu hast nicht gen[ue]gend Geld für diesen Command!"; + public static String DE_Buy = "[prefix] Du hast f[ue]r diesen Command [price] bezahlt."; + public static String DE_NoMoney = "[prefix] Du hast nicht gen[ue]gend Geld für diesen Command!"; } diff --git a/src/main/java/net/t2code/alias/Spigot/config/languages/SelectMessages.java b/src/main/java/net/t2code/alias/Spigot/config/languages/SelectMessages.java index 6f48932..837a7da 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/languages/SelectMessages.java +++ b/src/main/java/net/t2code/alias/Spigot/config/languages/SelectMessages.java @@ -44,6 +44,9 @@ public class SelectMessages { } else selectMSG = SelectConfig.language; YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(msg); + if (yamlConfiguration.get("Plugin.Prefix") != null) { + Util.setPrefix(replace(yamlConfiguration.getString("Plugin.Prefix"))); + } onlyForPlayer = replace(yamlConfiguration.getString("Plugin.OnlyForPlayer")); aliasDisabled = replace(yamlConfiguration.getString("Plugin.AliasDisabled")); reloadStart = replace(yamlConfiguration.getString("Plugin.Reload.Start")); diff --git a/src/main/java/net/t2code/alias/Spigot/config/subAlias/CreateExampleSubAliasConfig.java b/src/main/java/net/t2code/alias/Spigot/config/subAlias/CreateExampleSubAliasConfig.java index e797b64..563932d 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/subAlias/CreateExampleSubAliasConfig.java +++ b/src/main/java/net/t2code/alias/Spigot/config/subAlias/CreateExampleSubAliasConfig.java @@ -25,6 +25,8 @@ public class CreateExampleSubAliasConfig { Config.set("SubAlias.SubAliasFor", "aliasexample1",yamlConfiguration); Config.set("SubAlias.Permission.Necessary", true, yamlConfiguration); + Config.set("SubAlias.Permission.Permission", "t2code.alias.use.subalias.", yamlConfiguration); + Config.set("SubAlias.Permission.CustomNoPermissionMSG", "", yamlConfiguration); Config.set("SubAlias.Cost.Enable", false,yamlConfiguration); Config.set("SubAlias.Cost.Price", 0.0,yamlConfiguration); @@ -37,11 +39,6 @@ public class CreateExampleSubAliasConfig { Config.set("SubAlias.Message.Enable", false, yamlConfiguration); Config.set("SubAlias.Message.Messages", Collections.emptyList(), yamlConfiguration); - Config.set("SubAlias.Message.TextBuilder.Enable", false, yamlConfiguration); - Config.set("SubAlias.Message.TextBuilder.Hover", "", yamlConfiguration); - Config.set("SubAlias.Message.TextBuilder.ClickEvent.Enable", false, yamlConfiguration); - Config.set("SubAlias.Message.TextBuilder.ClickEvent.Action", "", yamlConfiguration); - Config.set("SubAlias.Message.TextBuilder.ClickEvent.ActionValue", "", yamlConfiguration); Config.set("SubAlias.Admin.Enable", true, yamlConfiguration); Config.set("SubAlias.Admin.Permission", "t2code.alias.admin", yamlConfiguration); @@ -53,11 +50,6 @@ public class CreateExampleSubAliasConfig { Config.set("SubAlias.Admin.Message.Enable", false, yamlConfiguration); Config.set("SubAlias.Admin.Message.Messages", Collections.emptyList(), yamlConfiguration); - Config.set("SubAlias.Admin.Message.TextBuilder.Enable", false, yamlConfiguration); - Config.set("SubAlias.Admin.Message.TextBuilder.Hover", "", yamlConfiguration); - Config.set("SubAlias.Admin.Message.TextBuilder.ClickEvent.Enable", false, yamlConfiguration); - Config.set("SubAlias.Admin.Message.TextBuilder.ClickEvent.Action", "", yamlConfiguration); - Config.set("SubAlias.Admin.Message.TextBuilder.ClickEvent.ActionValue", "", yamlConfiguration); Config.set("SubAlias.Console.Enable", false, yamlConfiguration); Config.set("SubAlias.Console.Command.Enable", false, yamlConfiguration); diff --git a/src/main/java/net/t2code/alias/Spigot/config/subAlias/SelectSubAlias.java b/src/main/java/net/t2code/alias/Spigot/config/subAlias/SelectSubAlias.java index 5d57453..23ab045 100644 --- a/src/main/java/net/t2code/alias/Spigot/config/subAlias/SelectSubAlias.java +++ b/src/main/java/net/t2code/alias/Spigot/config/subAlias/SelectSubAlias.java @@ -1,13 +1,20 @@ package net.t2code.alias.Spigot.config.subAlias; +import com.google.common.base.Preconditions; import net.t2code.alias.Spigot.Main; +import net.t2code.alias.Spigot.config.alias.AliasConfigConverter; import net.t2code.alias.Spigot.objects.SubAliasObject; import net.t2code.alias.Util; import net.t2code.lib.Spigot.Lib.messages.send; +import org.bukkit.Bukkit; +import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.YamlConfiguration; import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; import java.util.List; +import java.util.logging.Level; public class SelectSubAlias { private static String Prefix = Util.getPrefix(); @@ -22,9 +29,21 @@ public class SelectSubAlias { if (config_gui.getName().equals("X_subAliasDeclaration_X.yml")) continue; String sub = config_gui.getName().substring(config_gui.getName().length() - 4); if (sub.equals(".yml")) { - - YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config_gui); - + YamlConfiguration yamlConfiguration; + try { + Preconditions.checkArgument(config_gui != null, "File cannot be null"); + YamlConfiguration config = new YamlConfiguration(); + config.load(config_gui); + yamlConfiguration = config; + } catch (FileNotFoundException var3) { + continue; + } catch (IOException var4) { + Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + config_gui, var4); + continue; + } catch (InvalidConfigurationException var5) { + Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + config_gui, var5); + continue; + } Boolean aliasEnable = yamlConfiguration.getBoolean("SubAlias.Enable"); List subAliasList = yamlConfiguration.getStringList("SubAlias.SubAliasList"); String subAliasFor = yamlConfiguration.getString("SubAlias.SubAliasFor"); @@ -38,6 +57,14 @@ public class SelectSubAlias { subAliasArg = args.length - 1; } Boolean permNecessary = yamlConfiguration.getBoolean("SubAlias.Permission.Necessary"); + if (yamlConfiguration.get("SubAlias.Permission.Permission") == null) { + AliasConfigConverter.convertAddPermission(yamlConfiguration, config_gui, true); + } + String permission = yamlConfiguration.getString("SubAlias.Permission.Permission"); + if (yamlConfiguration.get("SubAlias.Permission.CustomNoPermissionMSG") == null) { + AliasConfigConverter.convertAddPermissionMSG(yamlConfiguration, config_gui, true); + } + String permissionMSG = yamlConfiguration.getString("SubAlias.Permission.CustomNoPermissionMSG"); Boolean costEnable = yamlConfiguration.getBoolean("SubAlias.Cost.Enable"); Double costPrice = yamlConfiguration.getDouble("SubAlias.Cost.Price"); @@ -69,7 +96,7 @@ public class SelectSubAlias { Boolean consoleMessageEnable = yamlConfiguration.getBoolean("SubAlias.Console.Message.Enable"); List consoleMessages = yamlConfiguration.getStringList("SubAlias.Console.Message.Messages"); - SubAliasObject subAlias = new SubAliasObject(aliasEnable, subAliasList, subAliasFor, subAliasArg, permNecessary, costEnable, costPrice, costAllowBypass, commandEnable, commandAsConsole, bungeeCommand, + SubAliasObject subAlias = new SubAliasObject(aliasEnable, subAliasList, subAliasFor, subAliasArg, permNecessary, permission, permissionMSG, costEnable, costPrice, costAllowBypass, commandEnable, commandAsConsole, bungeeCommand, command, messageEnable, messages, adminEnable, adminPermission, adminCommandEnable, adminCommandAsConsole, adminBungeeCommand, adminCommands, adminMessageEnable, adminMessages, consoleEnable, consoleCommandEnable, consoleBungeeCommand, consoleCommands, consoleMessageEnable, consoleMessages); for (String sal : subAliasList) { diff --git a/src/main/java/net/t2code/alias/Spigot/objects/AliasObject.java b/src/main/java/net/t2code/alias/Spigot/objects/AliasObject.java index 4400520..6ab3eab 100644 --- a/src/main/java/net/t2code/alias/Spigot/objects/AliasObject.java +++ b/src/main/java/net/t2code/alias/Spigot/objects/AliasObject.java @@ -7,6 +7,8 @@ public class AliasObject { public List aliasList; public Boolean permNecessary; + public String permission; + public String permissionMSG; public Boolean costEnable; public Double costPrice; @@ -38,6 +40,8 @@ public class AliasObject { public AliasObject(Boolean aliasEnable, List aliasList, Boolean permNecessary, + String permission, + String permissionMSG, Boolean costEnable, Double costPrice, @@ -66,8 +70,10 @@ public class AliasObject { Boolean consoleMessageEnable, List consoleMessages) { this.aliasEnable = aliasEnable; - this.aliasList=aliasList; + this.aliasList = aliasList; this.permNecessary = permNecessary; + this.permission = permission; + this.permissionMSG = permissionMSG; this.costEnable = costEnable; this.costPrice = costPrice; diff --git a/src/main/java/net/t2code/alias/Spigot/objects/SubAliasObject.java b/src/main/java/net/t2code/alias/Spigot/objects/SubAliasObject.java index 565cbd7..777bfa0 100644 --- a/src/main/java/net/t2code/alias/Spigot/objects/SubAliasObject.java +++ b/src/main/java/net/t2code/alias/Spigot/objects/SubAliasObject.java @@ -9,6 +9,8 @@ public class SubAliasObject { public String subAliasFor; public Boolean permNecessary; + public String permission; + public String permissionMSG; public Boolean costEnable; public Double costPrice; @@ -42,6 +44,8 @@ public class SubAliasObject { String subAliasFor, Integer subAliasArg, Boolean permNecessary, + String permission, + String permissionMSG, Boolean costEnable, Double costPrice, @@ -74,6 +78,8 @@ public class SubAliasObject { this.subAliasFor = subAliasFor; this.subAliasArg = subAliasArg; this.permNecessary = permNecessary; + this.permission = permission; + this.permissionMSG = permissionMSG; this.costEnable = costEnable; this.costPrice = costPrice; diff --git a/src/main/java/net/t2code/alias/Util.java b/src/main/java/net/t2code/alias/Util.java index 9aac550..82beb79 100644 --- a/src/main/java/net/t2code/alias/Util.java +++ b/src/main/java/net/t2code/alias/Util.java @@ -31,4 +31,8 @@ public class Util { public static String getDiscord() { return Discord; } + + public static void setPrefix(String prefix) { + Prefix = prefix; + } } diff --git a/src/main/resources/Alias/X_aliasDeclaration_X.yml b/src/main/resources/Alias/X_aliasDeclaration_X.yml index 8272a5d..c11bb9f 100644 --- a/src/main/resources/Alias/X_aliasDeclaration_X.yml +++ b/src/main/resources/Alias/X_aliasDeclaration_X.yml @@ -1,24 +1,26 @@ #################################################################### -## To create another alias, simply copy the file ## -## and name it what you want the aliascommand to be. ## -## The alias command is always the filename without .yml!!! ## +## The alias command is no longer the filename! ## +## Multiple alias commands can now be specified in one file, ## +## so there is no need to create multiple files! ## +## This option is under 'Alias.AliasList' ## #################################################################### Alias: # Here you can disable the alias Enable: true - - - # >>>>>> New 1.1 <<<<<< <<<<<<<<<<<<<<<<<<<<< + # Specify here what the Alias commands should be for this function AliasList: - - alias1 - - alias2 - - + - aliasexample1 + - aliasexample2 Permission: # Here you can say if a permission is needed to use the alias# - # Permission: t2code.alias.use. Necessary: true + # Here you can set the permission for the alias. + # The placeholder is the alias name. + # If you have set multiple alias referrers in the list 'Alias.AliasList' you have a permission for each alias. + Permission: 't2code.alias.use.' + # Here you can set a custom No Permission message for this alias. If you want to use the default message, just leave this blank. + CustomNoPermissionMSG: "" Cost: # Here you can say if you have to pay for the alias Enable: false @@ -37,14 +39,33 @@ Alias: BungeeCommand: false # Here you can specify one or more commands to be executed. # Placeholder: [player] = The player who executes the alias - Commands: [] + Commands: [ ] Message: # Here you can specify whether the player should receive a message. Enable: false # Specify here the message that the player should get. # Multiple lines can be used and placeholders are supported! # Placeholder: [player] = The player who executes the alias - Messages: [] + # + # You can use Minecraft custom color codes: https://minecraft.fandom.com/de/wiki/Formatierungscodes + # You can use the hover module from T2Code: + # You can add a hover and/or clickable feature to all messages sent to players. + # Use /*/ to separate the message. + # Use [nl] to set a line break in a message or hover. + # Hover message: /*/ + # Message with hover and click function: /*//*//*/ + # Message only with click function: /*//*//*/ + # Action: + # - OPEN_URL - Opens a URL under the path specified in ActionValue. + # - OPEN_FILE - Opens a file under the path specified by ActionValue. + # - RUN_COMMAND - Runs the command specified by ActionValue. + # - SUGGEST_COMMAND - Inserts the string specified in ActionValue into the player text box. + # - CHANGE_PAGE - Changes to the page number in a book specified by ActionValue. + # - COPY_TO_CLIPBOARD - Copies the string specified by ActionValue to the player's clipboard. + # You can also use MiniMessage: + # Wiki: https://docs.adventure.kyori.net/minimessage/format.html + # WebUI: https://webui.adventure.kyori.net + Messages: [ ] # Here you can specify that players with the permission () have a different function than other players. # For example, you can say that players should come to a certain point and players with the admin function only to the server to the position where they were before. @@ -67,13 +88,32 @@ Alias: BungeeCommand: false # Here you can specify one or more commands to be executed. # Placeholder: [player] = The player who executes the alias - Commands: [] + Commands: [ ] Message: # Here you can specify whether the player should receive a message. Enable: false # Specify here the message that the player should get. # Multiple lines can be used and placeholders are supported! # Placeholder: [player] = The player who executes the alias + # + # You can use Minecraft custom color codes: https://minecraft.fandom.com/de/wiki/Formatierungscodes + # You can use the hover module from T2Code: + # You can add a hover and/or clickable feature to all messages sent to players. + # Use /*/ to separate the message. + # Use [nl] to set a line break in a message or hover. + # Hover message: /*/ + # Message with hover and click function: /*//*//*/ + # Message only with click function: /*//*//*/ + # Action: + # - OPEN_URL - Opens a URL under the path specified in ActionValue. + # - OPEN_FILE - Opens a file under the path specified by ActionValue. + # - RUN_COMMAND - Runs the command specified by ActionValue. + # - SUGGEST_COMMAND - Inserts the string specified in ActionValue into the player text box. + # - CHANGE_PAGE - Changes to the page number in a book specified by ActionValue. + # - COPY_TO_CLIPBOARD - Copies the string specified by ActionValue to the player's clipboard. + # You can also use MiniMessage: + # Wiki: https://docs.adventure.kyori.net/minimessage/format.html + # WebUI: https://webui.adventure.kyori.net Messages: [ ] Console: @@ -91,4 +131,4 @@ Alias: # Here you can specify whether the player should receive a message. Enable: false # Specify here the message that the player should get. - Messages: [ ] + Messages: [ ] \ No newline at end of file diff --git a/src/main/resources/SubAlias/X_subAliasDeclaration_X.yml b/src/main/resources/SubAlias/X_subAliasDeclaration_X.yml index 34e11cc..3f64cc9 100644 --- a/src/main/resources/SubAlias/X_subAliasDeclaration_X.yml +++ b/src/main/resources/SubAlias/X_subAliasDeclaration_X.yml @@ -1,25 +1,26 @@ -#################################################################### -## To create another alias, simply copy the file ## -## and name it what you want the aliascommand to be. ## -## The alias command is always the filename without .yml!!! ## -#################################################################### +# SubAlias: # Here you can disable the alias Enable: true - - - # >>>>>> New 1.1 <<<<<< <<<<<<<<<<<<<<<<<<<<< + # Specify here what the SubAlias commands should be for this function SubAliasList: - subalias1 + # Enter here the alias command where the subalias should follow. + # For example: + # - aliasexample1 -> aliasexample1 + # - aliasexample2 test -> aliasexample2 test SubAliasFor: - - alias1 - - + - aliasexample1 Permission: # Here you can say if a permission is needed to use the alias# - # Permission: t2code.subalias.use. Necessary: true + # Here you can set the permission for the alias. + # The placeholder is the alias name. + # If you have set multiple alias referrers in the list 'Alias.AliasList' you have a permission for each alias. + Permission: 't2code.alias.use.subalias.' + # Here you can set a custom No Permission message for this alias. If you want to use the default message, just leave this blank. + CustomNoPermissionMSG: "" Cost: # Here you can say if you have to pay for the alias Enable: false @@ -45,6 +46,25 @@ SubAlias: # Specify here the message that the player should get. # Multiple lines can be used and placeholders are supported! # Placeholder: [player] = The player who executes the alias + # + # You can use Minecraft custom color codes: https://minecraft.fandom.com/de/wiki/Formatierungscodes + # You can use the hover module from T2Code: + # You can add a hover and/or clickable feature to all messages sent to players. + # Use /*/ to separate the message. + # Use [nl] to set a line break in a message or hover. + # Hover message: /*/ + # Message with hover and click function: /*//*//*/ + # Message only with click function: /*//*//*/ + # Action: + # - OPEN_URL - Opens a URL under the path specified in ActionValue. + # - OPEN_FILE - Opens a file under the path specified by ActionValue. + # - RUN_COMMAND - Runs the command specified by ActionValue. + # - SUGGEST_COMMAND - Inserts the string specified in ActionValue into the player text box. + # - CHANGE_PAGE - Changes to the page number in a book specified by ActionValue. + # - COPY_TO_CLIPBOARD - Copies the string specified by ActionValue to the player's clipboard. + # You can also use MiniMessage: + # Wiki: https://docs.adventure.kyori.net/minimessage/format.html + # WebUI: https://webui.adventure.kyori.net Messages: [] # Here you can specify that players with the permission () have a different function than other players. @@ -75,6 +95,25 @@ SubAlias: # Specify here the message that the player should get. # Multiple lines can be used and placeholders are supported! # Placeholder: [player] = The player who executes the alias + # + # You can use Minecraft custom color codes: https://minecraft.fandom.com/de/wiki/Formatierungscodes + # You can use the hover module from T2Code: + # You can add a hover and/or clickable feature to all messages sent to players. + # Use /*/ to separate the message. + # Use [nl] to set a line break in a message or hover. + # Hover message: /*/ + # Message with hover and click function: /*//*//*/ + # Message only with click function: /*//*//*/ + # Action: + # - OPEN_URL - Opens a URL under the path specified in ActionValue. + # - OPEN_FILE - Opens a file under the path specified by ActionValue. + # - RUN_COMMAND - Runs the command specified by ActionValue. + # - SUGGEST_COMMAND - Inserts the string specified in ActionValue into the player text box. + # - CHANGE_PAGE - Changes to the page number in a book specified by ActionValue. + # - COPY_TO_CLIPBOARD - Copies the string specified by ActionValue to the player's clipboard. + # You can also use MiniMessage: + # Wiki: https://docs.adventure.kyori.net/minimessage/format.html + # WebUI: https://webui.adventure.kyori.net Messages: [ ] Console: @@ -92,4 +131,4 @@ SubAlias: # Here you can specify whether the player should receive a message. Enable: false # Specify here the message that the player should get. - Messages: [ ] + Messages: [ ] \ No newline at end of file