From e27b79f1b58d74b6b7bbfd73965c386333997e39 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Sat, 3 Feb 2024 00:43:11 +0800 Subject: [PATCH] Platform api --- build.gradle | 2 +- src/main/java/io/izzel/arclight/api/Arclight.java | 10 ++++++++++ .../java/io/izzel/arclight/api/ArclightPlatform.java | 10 ++++++++++ .../java/io/izzel/arclight/api/ArclightServer.java | 6 ++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/main/java/io/izzel/arclight/api/ArclightPlatform.java diff --git a/build.gradle b/build.gradle index b683733..a17ea96 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group 'io.izzel.arclight' -version '1.5.6' +version '1.6.0' repositories { mavenCentral() diff --git a/src/main/java/io/izzel/arclight/api/Arclight.java b/src/main/java/io/izzel/arclight/api/Arclight.java index 832bebe..483d07d 100644 --- a/src/main/java/io/izzel/arclight/api/Arclight.java +++ b/src/main/java/io/izzel/arclight/api/Arclight.java @@ -34,6 +34,16 @@ public static TickingTracker getTickingTracker() { return getServer().getTickingTracker(); } + /** + * Get current platform Arclight is running + * + * @return current platform + * @since 1.6.0 + */ + public static ArclightPlatform getPlatform() { + return getServer().getPlatform(); + } + private static ArclightServer getServer() { return Objects.requireNonNull(server, "Server not set!"); } diff --git a/src/main/java/io/izzel/arclight/api/ArclightPlatform.java b/src/main/java/io/izzel/arclight/api/ArclightPlatform.java new file mode 100644 index 0000000..8f3dab7 --- /dev/null +++ b/src/main/java/io/izzel/arclight/api/ArclightPlatform.java @@ -0,0 +1,10 @@ +package io.izzel.arclight.api; + +/** + * Platforms where Arclight supports + */ +public enum ArclightPlatform { + VANILLA, + FORGE, + NEOFORGE +} diff --git a/src/main/java/io/izzel/arclight/api/ArclightServer.java b/src/main/java/io/izzel/arclight/api/ArclightServer.java index c98f10d..2619667 100644 --- a/src/main/java/io/izzel/arclight/api/ArclightServer.java +++ b/src/main/java/io/izzel/arclight/api/ArclightServer.java @@ -22,4 +22,10 @@ default ArclightVersion getVersion() { * @see Arclight#getTickingTracker() */ TickingTracker getTickingTracker(); + + /** + * @return current platform + * @see Arclight#getPlatform() + */ + ArclightPlatform getPlatform(); }