File tree 3 files changed +64
-0
lines changed
src/main/java/themeparkcraft.core.api
3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1
1
package themeparkcraft .core .api ;
2
2
3
+ import org .bukkit .plugin .java .JavaPlugin ;
4
+ import themeparkcraft .core .api .server .Server ;
5
+
6
+ import javax .annotation .Nonnull ;
7
+
3
8
@ SuppressWarnings ({"unused" , "UnusedReturnValue" })
4
9
public final class Core {
5
10
11
+ private static CoreServer server ;
12
+
13
+ /**
14
+ * Get the JavaPlugin instance of CorePlugin.
15
+ * <br>
16
+ * This gives you access to some Bukkit features that rely on this instance.
17
+ *
18
+ * @return JavaPlugin instance of CorePlugin
19
+ */
20
+ @ Nonnull
21
+ public static JavaPlugin getInstance () {
22
+ return server .getInstance ();
23
+ }
6
24
25
+ /**
26
+ * Get the {@link Server} object, granting access to all server-related features.
27
+ *
28
+ * @return Server object
29
+ */
30
+ @ Nonnull
31
+ public static Server server () {
32
+ return server .server ();
33
+ }
7
34
}
Original file line number Diff line number Diff line change 1
1
package themeparkcraft .core .api ;
2
2
3
+ import org .bukkit .plugin .java .JavaPlugin ;
3
4
import org .jetbrains .annotations .ApiStatus ;
5
+ import themeparkcraft .core .api .server .Server ;
6
+
7
+ import javax .annotation .Nonnull ;
4
8
5
9
@ ApiStatus .Internal
6
10
public interface CoreServer {
11
+
12
+ @ Nonnull
13
+ JavaPlugin getInstance ();
14
+
15
+ @ Nonnull
16
+ Server server ();
7
17
}
Original file line number Diff line number Diff line change
1
+ package themeparkcraft .core .api .server ;
2
+
3
+ import javax .annotation .Nonnull ;
4
+
5
+ @ SuppressWarnings ("unused" )
6
+ public interface Server {
7
+
8
+ /**
9
+ * Get the server type.
10
+ *
11
+ * @return the server type
12
+ */
13
+ @ Nonnull
14
+ ServerType type ();
15
+
16
+ /**
17
+ * Gets whether the server is fully started.
18
+ *
19
+ * @return true, if the server is fully started
20
+ */
21
+ boolean isFullyStarted ();
22
+
23
+ /**
24
+ * Restarts the server.
25
+ */
26
+ void restart ();
27
+ }
You can’t perform that action at this time.
0 commit comments