From 34637ac536ae2ba8653977df9a7915b17cf3fef6 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 16 Nov 2019 01:01:52 +0100 Subject: [PATCH] Disable test by default, config desc. #79 Fixed IntelliJ compiler version... --- .idea/compiler.xml | 32 +++++++------------ BuildConfigUpdater/BuildConfigUpdater.iml | 2 -- .../buttondevteam/core/ComponentCommand.java | 15 +++++++-- .../java/buttondevteam/core/MainPlugin.java | 2 +- .../java/buttondevteam/lib/chat/Command2.java | 6 ++-- CorePOM/CorePOM.iml | 2 +- CorePOM/pom.xml | 6 ++-- 7 files changed, 32 insertions(+), 33 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 863d6fa..3fb39be 100755 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -9,28 +9,16 @@ - + + + - - - - - - - - - - - - - - @@ -44,9 +32,11 @@ - + + + @@ -54,19 +44,19 @@ - + - - + + - + diff --git a/BuildConfigUpdater/BuildConfigUpdater.iml b/BuildConfigUpdater/BuildConfigUpdater.iml index 74e6815..67aa057 100644 --- a/BuildConfigUpdater/BuildConfigUpdater.iml +++ b/BuildConfigUpdater/BuildConfigUpdater.iml @@ -18,8 +18,6 @@ - - diff --git a/ButtonCore/src/main/java/buttondevteam/core/ComponentCommand.java b/ButtonCore/src/main/java/buttondevteam/core/ComponentCommand.java index 10b4b16..4e99610 100644 --- a/ButtonCore/src/main/java/buttondevteam/core/ComponentCommand.java +++ b/ButtonCore/src/main/java/buttondevteam/core/ComponentCommand.java @@ -23,7 +23,10 @@ public class ComponentCommand extends ICommand2MC { getManager().addParamConverter(Plugin.class, arg -> Bukkit.getPluginManager().getPlugin(arg), "Plugin not found!"); } - @Subcommand + @Subcommand(helpText = { + "Enable component", + "Temporarily enables a component. If you want to permanently enable a component, change it's 'enabled' config option.\"" + }) public boolean enable(CommandSender sender, Plugin plugin, String component) { if (plugin instanceof ButtonPlugin) ((ButtonPlugin) plugin).justReload(); @@ -32,12 +35,18 @@ public class ComponentCommand extends ICommand2MC { return enable_disable(sender, plugin, component, true); } - @Subcommand + @Subcommand(helpText = { + "Disable component", + "Temporarily disables a component. If you want to permanently disable a component, change it's 'enabled' config option." + }) public boolean disable(CommandSender sender, Plugin plugin, String component) { return enable_disable(sender, plugin, component, false); } - @Subcommand + @Subcommand(helpText = { + "List components", + "Lists all of the registered Chroma components" + }) public boolean list(CommandSender sender, @Command2.OptionalArg String plugin) { sender.sendMessage("ยง6List of components:"); Component.getComponents().values().stream().filter(c -> plugin == null || c.getPlugin().getName().equalsIgnoreCase(plugin)) //If plugin is null, don't check diff --git a/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java b/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java index 0fbdca1..0b3eacc 100755 --- a/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java +++ b/ButtonCore/src/main/java/buttondevteam/core/MainPlugin.java @@ -71,7 +71,7 @@ public class MainPlugin extends ButtonPlugin { } public ConfigData test() { - return getIConfig().getData("test", true); + return getIConfig().getData("test", false); } @Override diff --git a/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java b/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java index 562de54..858e228 100644 --- a/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/chat/Command2.java @@ -247,7 +247,7 @@ public abstract class Command2 public abstract void registerCommand(TC command); - protected void registerCommand(TC command, char commandChar) { + protected void registerCommand(TC command, @SuppressWarnings("SameParameterValue") char commandChar) { val path = command.getCommandPath(); int x = path.indexOf(' '); val mainPath = commandChar + path.substring(0, x == -1 ? path.length() : x); @@ -277,7 +277,7 @@ public abstract class Command2 if (ht != null) { val subcommand = commandChar + path + //Add command path (class name by default) (method.getName().equals("def") ? "" : " " + method.getName().replace('_', ' ').toLowerCase()); //Add method name, unless it's 'def' - ht = getHelpText(method, ht, subcommand); + ht = getParameterHelp(method, ht, subcommand); subcommands.put(subcommand, new SubcommandData<>(method, command, ht)); //Result of the above (def) is that it will show the help text scmdHelpList.add(subcommand); nosubs = false; @@ -299,7 +299,7 @@ public abstract class Command2 } } - private String[] getHelpText(Method method, String[] ht, String subcommand) { + private String[] getParameterHelp(Method method, String[] ht, String subcommand) { val str = method.getDeclaringClass().getResourceAsStream("/commands.yml"); if (str == null) TBMCCoreAPI.SendException("Error while getting command data!", new Exception("Resource not found!")); diff --git a/CorePOM/CorePOM.iml b/CorePOM/CorePOM.iml index 7d05a81..de84cf2 100644 --- a/CorePOM/CorePOM.iml +++ b/CorePOM/CorePOM.iml @@ -5,7 +5,7 @@ - + diff --git a/CorePOM/pom.xml b/CorePOM/pom.xml index 024d7eb..9fa787f 100755 --- a/CorePOM/pom.xml +++ b/CorePOM/pom.xml @@ -95,10 +95,12 @@ org.apache.maven.plugins maven-compiler-plugin - 13 + 11 +