Added onPostReload event. Closes #223.

This commit is contained in:
Stan Hebben committed 2015-09-06 08:53:04 +02:00
1 parent 4b8af78057
commit 34a2469cfc
1 file changed
+7
@@ -67,6 +67,7 @@ public class MineTweakerImplementationAPI {
private static final ListenPlayerLoggedOut LISTEN_LOGOUT = new ListenPlayerLoggedOut();
private static final ListenBlockInfo LISTEN_BLOCK_INFO = new ListenBlockInfo();
private static final EventList<ReloadEvent> ONRELOAD = new EventList<ReloadEvent>();
private static final EventList<ReloadEvent> ONPOSTRELOAD = new EventList<ReloadEvent>();
static {
minetweakerCommands = new HashMap<String, MineTweakerCommand>();
@@ -550,6 +551,10 @@ public class MineTweakerImplementationAPI {
public static IEventHandle onReloadEvent(IEventHandler<ReloadEvent> handler) {
return ONRELOAD.add(handler);
}
public static IEventHandle onPostReload(IEventHandler<ReloadEvent> handler) {
return ONPOSTRELOAD.add(handler);
}
/**
* Must be called upon server start.
@@ -653,6 +658,8 @@ public class MineTweakerImplementationAPI {
if (MineTweakerAPI.server != null) {
platform.distributeScripts(MineTweakerAPI.tweaker.getScriptData());
}
ONPOSTRELOAD.publish(new ReloadEvent());
}
/**