Skip to content

Commit

Permalink
Platform api
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Feb 2, 2024
1 parent 156498b commit e27b79f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'io.izzel.arclight'
version '1.5.6'
version '1.6.0'

repositories {
mavenCentral()
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/io/izzel/arclight/api/Arclight.java
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/io/izzel/arclight/api/ArclightPlatform.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.izzel.arclight.api;

/**
* Platforms where Arclight supports
*/
public enum ArclightPlatform {
VANILLA,
FORGE,
NEOFORGE
}
6 changes: 6 additions & 0 deletions src/main/java/io/izzel/arclight/api/ArclightServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ default ArclightVersion getVersion() {
* @see Arclight#getTickingTracker()
*/
TickingTracker getTickingTracker();

/**
* @return current platform
* @see Arclight#getPlatform()
*/
ArclightPlatform getPlatform();
}

0 comments on commit e27b79f

Please sign in to comment.