From c1751b8f20c83ec41fff566d8a8a70365057343c Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 5 Nov 2017 03:04:51 +0100 Subject: [PATCH] Some stuff I should've committed for a whiile --- .travis.yml | 4 +-- ButtonCore/pom.xml | 2 +- .../buttondevteam/core/CommandCaller.java | 5 +++- .../java/buttondevteam/lib/chat/Color.java | 29 ++++--------------- .../lib/chat/TBMCCommandBase.java | 2 +- ButtonProcessor/.classpath | 5 ++++ .../org.eclipse.core.resources.prefs | 1 + 7 files changed, 19 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index dfd0224..808d9b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,10 @@ cache: directories: - $HOME/.m2/repository/org/ before_install: | # Wget BuildTools and run if cached folder not found - if [ ! -d "$HOME/.m2/repository/org/spigotmc/spigot/1.12.1-R0.1-SNAPSHOT" ]; then + if [ ! -d "$HOME/.m2/repository/org/spigotmc/spigot/1.12.2-R0.1-SNAPSHOT" ]; then wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar # grep so that download counts don't appear in log files - java -jar BuildTools.jar --rev 1.12.1 | grep -vE "[^/ ]*/[^/ ]*\s*KB\s*$" | grep -v "^\s*$" + java -jar BuildTools.jar --rev 1.12.2 | grep -vE "[^/ ]*/[^/ ]*\s*KB\s*$" | grep -v "^\s*$" fi language: java jdk: diff --git a/ButtonCore/pom.xml b/ButtonCore/pom.xml index 2504963..be012ac 100644 --- a/ButtonCore/pom.xml +++ b/ButtonCore/pom.xml @@ -103,7 +103,7 @@ org.spigotmc spigot-api - 1.9.2-R0.1-SNAPSHOT + 1.12.2-R0.1-SNAPSHOT provided diff --git a/ButtonCore/src/main/java/buttondevteam/core/CommandCaller.java b/ButtonCore/src/main/java/buttondevteam/core/CommandCaller.java index 26b0c47..00c2797 100644 --- a/ButtonCore/src/main/java/buttondevteam/core/CommandCaller.java +++ b/ButtonCore/src/main/java/buttondevteam/core/CommandCaller.java @@ -33,8 +33,11 @@ public class CommandCaller implements CommandExecutor { if (pc == null) throw new Exception("Top level command " + topcmd + " not registered in plugin.yml for plugin: " + cmd.getPlugin().getName()); - else + else { pc.setExecutor(instance); + String[] helptext = cmd.GetHelpText(topcmd); + pc.setUsage(helptext.length > 1 ? helptext[1] : helptext[0]); + } } } diff --git a/ButtonCore/src/main/java/buttondevteam/lib/chat/Color.java b/ButtonCore/src/main/java/buttondevteam/lib/chat/Color.java index db646bb..98f16dd 100644 --- a/ButtonCore/src/main/java/buttondevteam/lib/chat/Color.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/chat/Color.java @@ -1,5 +1,10 @@ package buttondevteam.lib.chat; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Getter public enum Color implements TellrawSerializableEnum { Black("black", 0, 0, 0), DarkBlue("dark_blue", 0, 0, 170), DarkGreen("dark_green", 0, 170, 0), DarkAqua("dark_aqua", 0, 170, 170), DarkRed("dark_red", 170, 0, 0), DarkPurple("dark_purple", 0, 170, 0), Gold("gold", 255, 170, @@ -12,28 +17,4 @@ public enum Color implements TellrawSerializableEnum { private final int red; private final int green; private final int blue; - - Color(String name, int red, int green, int blue) { - this.name = name; - this.red = red; - this.green = green; - this.blue = blue; - } - - @Override - public String getName() { - return name; - } - - public int getRed() { - return red; - } - - public int getGreen() { - return green; - } - - public int getBlue() { - return blue; - } } \ No newline at end of file diff --git a/ButtonCore/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java b/ButtonCore/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java index 1627c34..e8c3c52 100644 --- a/ButtonCore/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java +++ b/ButtonCore/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java @@ -56,7 +56,7 @@ public abstract class TBMCCommandBase { if (!cl.isAnnotationPresent(CommandClass.class) || (newpath = cl.getAnnotation(CommandClass.class).path()).length() == 0 || newpath.equals(prevpath)) { - if (Modifier.isAbstract(cl.getModifiers()) && (!cl.isAnnotationPresent(CommandClass.class)) + if ((Modifier.isAbstract(cl.getModifiers()) && !cl.isAnnotationPresent(CommandClass.class)) || cl.getAnnotation(CommandClass.class).excludeFromPath()) // <-- continue; newpath = getFromClass.apply(cl); diff --git a/ButtonProcessor/.classpath b/ButtonProcessor/.classpath index af1430b..1a8c6f1 100644 --- a/ButtonProcessor/.classpath +++ b/ButtonProcessor/.classpath @@ -22,5 +22,10 @@ + + + + + diff --git a/ButtonProcessor/.settings/org.eclipse.core.resources.prefs b/ButtonProcessor/.settings/org.eclipse.core.resources.prefs index f9fe345..839d647 100644 --- a/ButtonProcessor/.settings/org.eclipse.core.resources.prefs +++ b/ButtonProcessor/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 encoding//src/test/java=UTF-8 encoding/=UTF-8