Regen inf

This commit is contained in:
Daniel Mills 2020-12-06 06:09:33 -05:00
parent 44ef039321
commit 0755e8f618
3 changed files with 21 additions and 20 deletions

View File

@ -498,11 +498,6 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
@Override @Override
public void clearRegeneratedLists(int x, int z) { public void clearRegeneratedLists(int x, int z) {
if (true)
{
return;
}
for(int i = 0; i < getComposite().getSize(); i++) for(int i = 0; i < getComposite().getSize(); i++)
{ {
getComposite().getEngine(i).getParallax().delete(x, z); getComposite().getEngine(i).getParallax().delete(x, z);
@ -511,6 +506,9 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
@Override @Override
public void regenerate(int x, int z) { public void regenerate(int x, int z) {
clearRegeneratedLists(x, z);
int xx = x*16;
int zz = z*16;
generateChunkRawData(getComposite().getWorld(), x, z, new TerrainChunk() { generateChunkRawData(getComposite().getWorld(), x, z, new TerrainChunk() {
@Override @Override
public void setRaw(ChunkData data) { public void setRaw(ChunkData data) {
@ -544,12 +542,15 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
@Override @Override
public void setBlock(int x, int y, int z, BlockData blockData) { public void setBlock(int x, int y, int z, BlockData blockData) {
Iris.edit.set(compound.getWorld(), x, y, z, blockData); if(!getBlockData(x,y,z).matches(blockData))
{
Iris.edit.set(compound.getWorld(), x+xx, y, z+zz, blockData);
}
} }
@Override @Override
public BlockData getBlockData(int x, int y, int z) { public BlockData getBlockData(int x, int y, int z) {
return Iris.edit.get(compound.getWorld(), x, y, z); return Iris.edit.get(compound.getWorld(), x+xx, y, z+zz);
} }
@Override @Override
@ -607,10 +608,6 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
Iris.edit.flushNow(); Iris.edit.flushNow();
for (BlockPopulator i : populators) {
Chunk chunk = getComposite().getWorld().getChunkAt(x, z);
i.populate(compound.getWorld(), new RNG(Cache.key(x, z)), chunk);
}
} }

View File

@ -409,13 +409,9 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer
} }
} }
x = Math.max(z, x);
x = (Math.max(x, 16) + 16) >> 4; x = (Math.max(x, 16) + 16) >> 4;
z = (Math.max(z, 16) + 16) >> 4;
x = x % 2 == 0 ? x + 1 : x; x = x % 2 == 0 ? x + 1 : x;
z = z % 2 == 0 ? z + 1 : z;
x = Math.max(x, z);
z = x;
Iris.verbose(getEngine().getDimension().getName() + " Parallax Size: " + x + ", " + z);
return x; return x;
} }

View File

@ -56,6 +56,8 @@ public class EnginePlayer {
} }
public void sample() { public void sample() {
try
{
if(ticksSinceLastSample() > 55 && player.getLocation().distanceSquared(lastLocation) > 9 * 9) if(ticksSinceLastSample() > 55 && player.getLocation().distanceSquared(lastLocation) > 9 * 9)
{ {
lastLocation = player.getLocation().clone(); lastLocation = player.getLocation().clone();
@ -64,6 +66,12 @@ public class EnginePlayer {
} }
} }
catch(Throwable ew)
{
}
}
private void sampleBiomeRegion() { private void sampleBiomeRegion() {
Location l = player.getLocation(); Location l = player.getLocation();
biome = engine.getBiome(l); biome = engine.getBiome(l);