Jigsaw fixes

This commit is contained in:
Daniel Mills
2021-01-28 00:28:55 -05:00
parent 66dde6c215
commit 4a05031a0f
14 changed files with 182 additions and 15 deletions

View File

@@ -127,6 +127,7 @@ public class IrisEngine extends BlockPopulator implements Engine
{
getWorldManager().spawnInitialEntities(c);
updateChunk(c);
placeTiles(c);
}
@Override

View File

@@ -9,6 +9,7 @@ import com.volmit.iris.util.J;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.RNG;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
@@ -34,6 +35,18 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
@Override
public void spawnInitialEntities(Chunk c) {
RNG rng = new RNG(Cache.key(c));
getEngine().getParallaxAccess().getEntitiesR(c.getX(), c.getZ()).iterateSync((x,y,z,e) -> {
if(e != null)
{
IrisEntity en = getData().getEntityLoader().load(e);
if(en != null){
en.spawn(getEngine(), new Location(c.getWorld(), x+(c.getX()<<4),y,z+(c.getZ()<<4)));
}
}
});
int x = (c.getX() * 16) + rng.nextInt(15);
int z = (c.getZ() * 16) + rng.nextInt(15);
int y = getEngine().getHeight(x, z) + 1;
@@ -43,6 +56,8 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
trySpawn(above.getEntityInitialSpawns(), c, rng);
trySpawn(region.getEntityInitialSpawns(), c, rng);
trySpawn(dim.getEntityInitialSpawns(), c, rng);
}
@Override