Fix world events

This commit is contained in:
Daniel Mills 2021-07-24 09:42:06 -04:00
parent 970a5ec763
commit a4ba07de99
2 changed files with 4 additions and 2 deletions

View File

@ -78,7 +78,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
@Override @Override
public void onEntitySpawn(EntitySpawnEvent e) { public void onEntitySpawn(EntitySpawnEvent e) {
if (getTarget().getWorld() == null || !getTarget().getWorld().equals(e.getEntity().getWorld())) { if (getTarget().getWorld() == null || !e.getEntity().getWorld().equals(getTarget().getWorld().realWorld())) {
return; return;
} }

View File

@ -69,11 +69,13 @@ public class HeadlessWorld {
} }
public World load() { public World load() {
return new WorldCreator(worldName) World w = new WorldCreator(worldName)
.environment(dimension.getEnvironment()) .environment(dimension.getEnvironment())
.seed(world.seed()) .seed(world.seed())
.generator(new EngineCompositeGenerator(dimension.getLoadKey(), !studio)) .generator(new EngineCompositeGenerator(dimension.getLoadKey(), !studio))
.createWorld(); .createWorld();
world.realWorld(w);
return w;
} }
public static HeadlessWorld from(World world) { public static HeadlessWorld from(World world) {