mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 04:29:05 +00:00
1.14+ support
This commit is contained in:
@@ -333,6 +333,11 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
|
||||
|
||||
public void close()
|
||||
{
|
||||
if(!isDev())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
getNoLoot().clear();
|
||||
getNoLoot().trimToSize();
|
||||
HandlerList.unregisterAll(this);
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class DimensionChunkGenerator extends ContextualChunkGenerator
|
||||
|
||||
if(!folder.exists())
|
||||
{
|
||||
Iris.error("Missing World iris/dimensions folder!");
|
||||
Iris.error("Missing World iris/dimensions folder! (" + folder.getAbsolutePath() + ")");
|
||||
setDimensionName("error-missing-dimension");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.volmit.iris.util.HeightMap;
|
||||
import com.volmit.iris.util.IObjectPlacer;
|
||||
import com.volmit.iris.util.IrisLock;
|
||||
import com.volmit.iris.util.IrisStructureResult;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.KMap;
|
||||
import com.volmit.iris.util.PrecisionStopwatch;
|
||||
@@ -62,6 +63,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple
|
||||
setParallaxMap(new AtomicWorldData(world));
|
||||
setGlText(new GenLayerText(this, rng.nextParallelRNG(32485)));
|
||||
setGlUpdate(null);
|
||||
J.a(() -> getDimension().getParallaxSize(this));
|
||||
}
|
||||
|
||||
protected void onClose()
|
||||
|
||||
@@ -138,6 +138,7 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
IrisRegion region = sampleRegion(rx, rz);
|
||||
IrisBiome biome = sampleTrueBiome(rx, rz, noise);
|
||||
IrisBiome landBiome = null;
|
||||
Biome onlyBiome = Iris.biome3d ? null : biome.getGroundBiome(getMasterRandom(), rz, getDimension().getFluidHeight(), rx);
|
||||
|
||||
if(biome == null)
|
||||
{
|
||||
@@ -204,17 +205,27 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
if(!biomeAssigned && biomeMap != null)
|
||||
{
|
||||
biomeAssigned = true;
|
||||
sliver.set(k, biome.getGroundBiome(getMasterRandom(), rz, k, rx));
|
||||
biomeMap.setBiome(x, z, biome);
|
||||
|
||||
for(int kv = max; kv < biomeMax; kv++)
|
||||
if(Iris.biome3d)
|
||||
{
|
||||
Biome skyBiome = biome.getSkyBiome(getMasterRandom(), rz, kv, rx);
|
||||
sliver.set(kv, skyBiome);
|
||||
sliver.set(k, biome.getGroundBiome(getMasterRandom(), rz, k, rx));
|
||||
|
||||
for(int kv = max; kv < biomeMax; kv++)
|
||||
{
|
||||
Biome skyBiome = biome.getSkyBiome(getMasterRandom(), rz, kv, rx);
|
||||
sliver.set(kv, skyBiome);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
sliver.set(getFluidHeight(), onlyBiome);
|
||||
}
|
||||
|
||||
biomeMap.setBiome(x, z, biome);
|
||||
}
|
||||
|
||||
if(k <= Math.max(height, fluidHeight))
|
||||
if(Iris.biome3d && k <= Math.max(height, fluidHeight))
|
||||
{
|
||||
sliver.set(k, biome.getGroundBiome(getMasterRandom(), rz, k, rx));
|
||||
}
|
||||
@@ -278,10 +289,13 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
|
||||
{
|
||||
for(CaveResult i : caveResults)
|
||||
{
|
||||
for(int j = i.getFloor(); j <= i.getCeiling(); j++)
|
||||
if(Iris.biome3d)
|
||||
{
|
||||
sliver.set(j, caveBiome);
|
||||
sliver.set(j, caveBiome.getGroundBiome(getMasterRandom(), rz, j, rx));
|
||||
for(int j = i.getFloor(); j <= i.getCeiling(); j++)
|
||||
{
|
||||
sliver.set(j, caveBiome);
|
||||
sliver.set(j, caveBiome.getGroundBiome(getMasterRandom(), rz, j, rx));
|
||||
}
|
||||
}
|
||||
|
||||
KList<BlockData> floor = caveBiome.generateLayers(wx, wz, rockRandom, i.getFloor() - 2, i.getFloor() - 2);
|
||||
|
||||
@@ -29,6 +29,7 @@ public class AtomicSliver
|
||||
public static boolean forgetful = false;
|
||||
private transient KMap<Integer, IrisBiome> truebiome;
|
||||
private transient KMap<Integer, Biome> biome;
|
||||
private transient Biome onlyBiome;
|
||||
private transient IrisLock lock = new IrisLock("Sliver");
|
||||
private transient int highestBiome = 0;
|
||||
private transient long last = M.ms();
|
||||
@@ -41,6 +42,7 @@ public class AtomicSliver
|
||||
|
||||
public AtomicSliver(int x, int z)
|
||||
{
|
||||
onlyBiome = null;
|
||||
this.x = x;
|
||||
this.z = z;
|
||||
blockUpdates = new KSet<>();
|
||||
@@ -164,9 +166,9 @@ public class AtomicSliver
|
||||
|
||||
public Biome getBiome(int h)
|
||||
{
|
||||
if(forgetful)
|
||||
if(!Iris.biome3d)
|
||||
{
|
||||
return Biome.THE_VOID;
|
||||
return onlyBiome != null ? onlyBiome : Biome.THE_VOID;
|
||||
}
|
||||
|
||||
last = M.ms();
|
||||
@@ -182,7 +184,17 @@ public class AtomicSliver
|
||||
public void set(int h, Biome d)
|
||||
{
|
||||
lock.lock();
|
||||
biome.put(h, d);
|
||||
|
||||
if(Iris.biome3d)
|
||||
{
|
||||
biome.put(h, d);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
onlyBiome = d;
|
||||
}
|
||||
|
||||
modified = true;
|
||||
highestBiome = h > highestBiome ? h : highestBiome;
|
||||
lock.unlock();
|
||||
@@ -220,13 +232,18 @@ public class AtomicSliver
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void write(BiomeGrid d)
|
||||
{
|
||||
if(forgetful)
|
||||
lock.lock();
|
||||
|
||||
if(!Iris.biome3d)
|
||||
{
|
||||
d.setBiome(x, z, onlyBiome);
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
lock.lock();
|
||||
|
||||
for(int i = 0; i <= highestBiome; i++)
|
||||
{
|
||||
if(biome.get(i) != null)
|
||||
@@ -234,15 +251,12 @@ public class AtomicSliver
|
||||
d.setBiome(x, i, z, biome.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
public void write(HeightMap height)
|
||||
{
|
||||
if(forgetful)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lock.lock();
|
||||
height.setHeight(x, z, highestBlock);
|
||||
lock.unlock();
|
||||
@@ -250,10 +264,6 @@ public class AtomicSliver
|
||||
|
||||
public void read(DataInputStream din) throws IOException
|
||||
{
|
||||
if(forgetful)
|
||||
{
|
||||
return;
|
||||
}
|
||||
lock.lock();
|
||||
this.block = new KMap<Integer, BlockData>();
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ public class GenLayerUpdate extends BlockPopulator
|
||||
}
|
||||
p.end();
|
||||
gen.getMetrics().getUpdate().put(p.getMilliseconds());
|
||||
|
||||
}
|
||||
|
||||
public void update(Chunk c, int x, int y, int z, int rx, int rz, RNG rng)
|
||||
|
||||
Reference in New Issue
Block a user