-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
ServerPrestartScriptEvent.java
40 lines (34 loc) · 1.36 KB
/
ServerPrestartScriptEvent.java
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
package com.denizenscript.denizen.events.server;
import com.denizenscript.denizen.events.BukkitScriptEvent;
import com.denizenscript.denizencore.events.ScriptEvent;
import com.denizenscript.denizencore.scripts.containers.core.WorldScriptContainer;
public class ServerPrestartScriptEvent extends BukkitScriptEvent {
// <--[event]
// @Events
// server prestart
//
// @Group Server
//
// @Triggers before the server finishes starting... fired after some saves are loaded, but before other data is loaded. Use with extreme caution.
//
// @Warning This event uses special pre-loading tricks to fire before everything else. Use extreme caution.
//
// @Example
// on server prestart:
// - createworld my_extra_world
//
// -->
public ServerPrestartScriptEvent() {
instance = this;
registerCouldMatcher("server prestart");
}
public static ServerPrestartScriptEvent instance;
public void specialHackRunEvent() {
for (WorldScriptContainer container : ScriptEvent.worldContainers) {
if (container.containsScriptSection("events.on server prestart") && container.shouldEnable()) {
ScriptPath path = new ScriptPath(container, "server prestart", "on server prestart");
clone().run(path);
}
}
}
}