aboutsummaryrefslogtreecommitdiff
path: root/spark-bukkit/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'spark-bukkit/src/main/java')
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java46
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java6
2 files changed, 52 insertions, 0 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
new file mode 100644
index 0000000..0cf9288
--- /dev/null
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitPlatformInfo.java
@@ -0,0 +1,46 @@
+/*
+ * This file is part of spark.
+ *
+ * Copyright (c) lucko (Luck) <luck@lucko.me>
+ * Copyright (c) contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package me.lucko.spark.bukkit;
+
+import me.lucko.spark.common.PlatformInfo;
+import org.bukkit.Bukkit;
+
+public class BukkitPlatformInfo implements PlatformInfo {
+ @Override
+ public Type getType() {
+ return Type.SERVER;
+ }
+
+ @Override
+ public String getName() {
+ return "Bukkit";
+ }
+
+ @Override
+ public String getVersion() {
+ return Bukkit.getVersion();
+ }
+
+ @Override
+ public String getMinecraftVersion() {
+ return Bukkit.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 eca4619..2ef11db 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,6 +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.sampler.ThreadDumper;
import me.lucko.spark.common.sampler.tick.TickHook;
import me.lucko.spark.common.sampler.tick.TickReporter;
@@ -148,6 +149,11 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin {
return null;
}
+ @Override
+ public PlatformInfo getPlatformInfo() {
+ return new BukkitPlatformInfo();
+ }
+
private static boolean classExists(String className) {
try {
Class.forName(className);