-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHySk.java
More file actions
76 lines (66 loc) · 1.62 KB
/
HySk.java
File metadata and controls
76 lines (66 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.github.skriptdev.skript.plugin;
import com.github.skriptdev.skript.api.utils.Utils;
import com.github.skriptdev.skript.plugin.command.SkriptCommand;
import com.hypixel.hytale.server.core.plugin.JavaPlugin;
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
import org.jetbrains.annotations.NotNull;
/**
* Main class for HySkript as a Hytale plugin.
*/
public class HySk extends JavaPlugin {
private static HySk INSTANCE;
private Skript skript;
/**
* @hidden
*/
public HySk(@NotNull JavaPluginInit init) {
super(init);
if (INSTANCE != null) {
throw new IllegalStateException("HySkript is already initialized!");
}
INSTANCE = this;
}
/**
* @hidden
*/
@Override
protected void setup() {
// Unused - for now
}
/**
* @hidden
*/
@Override
protected void start() {
this.skript = new Skript(this);
new SkriptCommand(getCommandRegistry());
BstatsMetrics.registerMetrics(this);
}
/**
* @hidden
*/
@Override
protected void shutdown() {
Utils.log("Shutting down HySkript...");
this.skript.shutdown();
Utils.log("HySkript shutdown complete!");
INSTANCE = null;
this.skript = null;
}
/**
* Get the Skript instance.
*
* @return The instance of Skript.
*/
public Skript getSkript() {
return this.skript;
}
/**
* Get the instance of HySkript.
*
* @return The instance of HySkript.
*/
public static HySk getInstance() {
return INSTANCE;
}
}