11package com .tcoded .folialib ;
22
33import com .tcoded .folialib .enums .ImplementationType ;
4- import com .tcoded .folialib .impl .ServerImplementation ;
4+ import com .tcoded .folialib .impl .PlatformScheduler ;
55import com .tcoded .folialib .util .InvalidTickDelayNotifier ;
66import org .bukkit .plugin .java .JavaPlugin ;
77
@@ -13,7 +13,7 @@ public class FoliaLib {
1313 private final JavaPlugin plugin ;
1414
1515 private final ImplementationType implementationType ;
16- private final ServerImplementation implementation ;
16+ private final PlatformScheduler scheduler ;
1717
1818 public FoliaLib (JavaPlugin plugin ) {
1919 this .plugin = plugin ;
@@ -31,10 +31,10 @@ public FoliaLib(JavaPlugin plugin) {
3131
3232 // Apply the implementation based on the type
3333 this .implementationType = foundType ;
34- this .implementation = this .createServerImpl (this .implementationType .getImplementationClassName ());
34+ this .scheduler = this .createServerImpl (this .implementationType .getImplementationClassName ());
3535
3636 // Check for valid implementation
37- if (this .implementation == null ) {
37+ if (this .scheduler == null ) {
3838 throw new IllegalStateException (
3939 "Failed to create server implementation. Please report this to the FoliaLib GitHub issues page. " +
4040 "Forks of server software may not all be supported. If you are using an unofficial fork, " +
@@ -62,9 +62,17 @@ public ImplementationType getImplType() {
6262 return implementationType ;
6363 }
6464
65+ /**
66+ * @deprecated Use {@link #getImplType()} instead. (forRemoval = true, since = "0.3.5")
67+ */
68+ @ Deprecated
6569 @ SuppressWarnings ("unused" )
66- public ServerImplementation getImpl () {
67- return implementation ;
70+ public PlatformScheduler getImpl () {
71+ return getScheduler ();
72+ }
73+
74+ public PlatformScheduler getScheduler () {
75+ return scheduler ;
6876 }
6977
7078 @ SuppressWarnings ("unused" )
@@ -105,11 +113,11 @@ public void enableInvalidTickValueDebug() {
105113
106114 // Internal Utils
107115
108- private ServerImplementation createServerImpl (String implName ) {
116+ private PlatformScheduler createServerImpl (String implName ) {
109117 String basePackage = this .getClass ().getPackage ().getName () + ".impl." ;
110118
111119 try {
112- return (ServerImplementation ) Class .forName (basePackage + implName )
120+ return (PlatformScheduler ) Class .forName (basePackage + implName )
113121 .getConstructor (this .getClass ())
114122 .newInstance (this );
115123 } catch (InstantiationException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException |
0 commit comments