world.spawnEntity hanging?

I have a custom ChunkGenerator, but when I try to call world.spawnEntity it freezes and my server never starts up. No errors, nothing.

Here’s the only code that should matter:

Location location = new Location(world, (double) chunkX * 16 + x, 48D, (double) chunkZ * 16 + z);
world.spawnEntity(location, EntityType.TROPICAL_FISH); // Never returns

the chunk isn’t loaded at the point the ChunkGenerator is tryna access it, you basically deadlocked the server by tryna load a chunk while it was generating it