diff options
Diffstat (limited to 'spark-bukkit/src')
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java | 16 | ||||
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java index 0cf9288..84ed1bf 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java @@ -20,10 +20,16 @@ package me.lucko.spark.bukkit; -import me.lucko.spark.common.PlatformInfo; -import org.bukkit.Bukkit; +import me.lucko.spark.common.platform.AbstractPlatformInfo; +import org.bukkit.Server; + +public class BukkitPlatformInfo extends AbstractPlatformInfo { + private final Server server; + + public BukkitPlatformInfo(Server server) { + this.server = server; + } -public class BukkitPlatformInfo implements PlatformInfo { @Override public Type getType() { return Type.SERVER; @@ -36,11 +42,11 @@ public class BukkitPlatformInfo implements PlatformInfo { @Override public String getVersion() { - return Bukkit.getVersion(); + return this.server.getVersion(); } @Override public String getMinecraftVersion() { - return Bukkit.getMinecraftVersion(); + return this.server.getMinecraftVersion(); } } diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java index 2ef11db..7d749eb 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java @@ -24,7 +24,7 @@ import me.lucko.spark.bukkit.placeholder.SparkMVdWPlaceholders; import me.lucko.spark.bukkit.placeholder.SparkPlaceholderApi; import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.SparkPlugin; -import me.lucko.spark.common.PlatformInfo; +import me.lucko.spark.common.platform.PlatformInfo; import me.lucko.spark.common.sampler.ThreadDumper; import me.lucko.spark.common.sampler.tick.TickHook; import me.lucko.spark.common.sampler.tick.TickReporter; @@ -151,7 +151,7 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin { @Override public PlatformInfo getPlatformInfo() { - return new BukkitPlatformInfo(); + return new BukkitPlatformInfo(getServer()); } private static boolean classExists(String className) { |