diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index 3922c65908..01bfb0986c 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -202,6 +202,7 @@ public class World{ */ public void beginMapLoad(){ generating = true; + Events.fire(new WorldLoadBeginEvent()); } /** @@ -209,6 +210,7 @@ public class World{ * A WorldLoadEvent will be fire. */ public void endMapLoad(){ + Events.fire(new WorldLoadEndEvent()); for(Tile tile : tiles){ //remove legacy blocks; they need to stop existing diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index faaad3d6be..9699e17393 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -77,8 +77,13 @@ public class EventType{ public static class MusicRegisterEvent{} /** Called *after* all the modded files have been added into Vars.tree */ public static class FileTreeInitEvent{} - /** Called when a game begins and the world tiles are loaded. Entities are not yet loaded at this stage. */ + + /** Called when a game begins and the world tiles are loaded, just set `generating = false`. Entities are not yet loaded at this stage. */ public static class WorldLoadEvent{} + /** Called when the world begin to load, just set `generating = true`. */ + public static class WorldLoadBeginEvent{} + /** Called when a game begins and the world tiles are initiated. About to updates tile proximity and sets up physics for the world(Before WorldLoadEvent) */ + public static class WorldLoadEndEvent{} public static class SaveLoadEvent{ public final boolean isMap;