diff options
author | Luck <git@lucko.me> | 2019-08-03 22:04:20 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-08-03 22:04:20 +0100 |
commit | 2a03b547c7714a130b2bc1407b12a8abd58a9069 (patch) | |
tree | c4306958d814964a58c472b959b94afda5ee3800 /spark-forge/src | |
parent | 4308eda6fd4ce3d637ad29b50f53d870ec1facbc (diff) | |
download | spark-2a03b547c7714a130b2bc1407b12a8abd58a9069.tar.gz spark-2a03b547c7714a130b2bc1407b12a8abd58a9069.tar.bz2 spark-2a03b547c7714a130b2bc1407b12a8abd58a9069.zip |
Some more reorganising
Diffstat (limited to 'spark-forge/src')
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java | 6 | ||||
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java | 4 | ||||
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java (renamed from spark-forge/src/main/java/me/lucko/spark/forge/SparkForgeMod.java) | 2 | ||||
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkPlugin.java | 16 |
4 files changed, 14 insertions, 14 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java index 5dd2ded..e4212ab 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java @@ -32,11 +32,11 @@ import java.util.stream.Stream; public class ForgeClientSparkPlugin extends ForgeSparkPlugin { - public static void register(SparkForgeMod mod) { + public static void register(ForgeSparkMod mod) { ClientCommandHandler.instance.registerCommand(new ForgeClientSparkPlugin(mod)); } - public ForgeClientSparkPlugin(SparkForgeMod mod) { + public ForgeClientSparkPlugin(ForgeSparkMod mod) { super(mod); } @@ -56,7 +56,7 @@ public class ForgeClientSparkPlugin extends ForgeSparkPlugin { } @Override - public String getLabel() { + public String getCommandName() { return "sparkc"; } diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java index 3c686ae..22b6adc 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.stream.Stream; public class ForgeServerSparkPlugin extends ForgeSparkPlugin { - public ForgeServerSparkPlugin(SparkForgeMod mod) { + public ForgeServerSparkPlugin(ForgeSparkMod mod) { super(mod); } @@ -55,7 +55,7 @@ public class ForgeServerSparkPlugin extends ForgeSparkPlugin { } @Override - public String getLabel() { + public String getCommandName() { return "spark"; } diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/SparkForgeMod.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java index 32dfd77..1659d6d 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/SparkForgeMod.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkMod.java @@ -36,7 +36,7 @@ import java.nio.file.Path; version = "@version@", acceptableRemoteVersions = "*" ) -public class SparkForgeMod { +public class ForgeSparkMod { private Path configDirectory = null; diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkPlugin.java index 039a7de..b2f2332 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeSparkPlugin.java @@ -39,11 +39,11 @@ import java.util.concurrent.ScheduledExecutorService; @SuppressWarnings("NullableProblems") public abstract class ForgeSparkPlugin implements SparkPlugin, ICommand { - private final SparkForgeMod mod; + private final ForgeSparkMod mod; private final ScheduledExecutorService scheduler; private final SparkPlatform platform; - protected ForgeSparkPlugin(SparkForgeMod mod) { + protected ForgeSparkPlugin(ForgeSparkMod mod) { this.mod = mod; this.scheduler = Executors.newSingleThreadScheduledExecutor( new ThreadFactoryBuilder().setNameFormat("spark-forge-async-worker").build() @@ -56,17 +56,17 @@ public abstract class ForgeSparkPlugin implements SparkPlugin, ICommand { @Override public String getVersion() { - return SparkForgeMod.class.getAnnotation(Mod.class).version(); + return ForgeSparkMod.class.getAnnotation(Mod.class).version(); } @Override - public Path getPluginFolder() { + public Path getPluginDirectory() { return this.mod.getConfigDirectory(); } @Override - public void runAsync(Runnable r) { - this.scheduler.execute(r); + public void executeAsync(Runnable task) { + this.scheduler.execute(task); } @Override @@ -78,7 +78,7 @@ public abstract class ForgeSparkPlugin implements SparkPlugin, ICommand { @Override public String getUsage(ICommandSender iCommandSender) { - return "/" + getLabel(); + return "/" + getCommandName(); } @Override @@ -103,6 +103,6 @@ public abstract class ForgeSparkPlugin implements SparkPlugin, ICommand { @Override public int compareTo(ICommand o) { - return getLabel().compareTo(o.getName()); + return getCommandName().compareTo(o.getName()); } } |