feat: post WorldUnloadEvent
@@ -5,6 +5,9 @@ import nullengine.Engine;
import nullengine.entity.Entity;
import nullengine.event.world.WorldCreateEvent;
import nullengine.event.world.WorldLoadEvent;
+import nullengine.event.world.WorldUnloadEvent;
+import nullengine.player.Player;
+import nullengine.player.Profile;
import nullengine.registry.Registries;
import nullengine.world.World;
import nullengine.world.WorldCreationSetting;
@@ -30,6 +33,12 @@ public class GameServerFullAsync extends GameBase {
super(engine, storagePath, data);
}
+ @Nonnull
+ @Override
+ public Player joinGame(Profile profile, Entity controlledEntity) {
+ return null;
+ }
+
@Nonnull
@Override
public World createWorld(@Nonnull String providerName, @Nonnull String name, @Nonnull WorldCreationSetting creationConfig) {
@@ -139,6 +148,7 @@ public class GameServerFullAsync extends GameBase {
}
worlds.remove(world.getName());
+ getEventBus().post(new WorldUnloadEvent(world));
}
@Override
