9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-28 11:39:07 +00:00
This commit is contained in:
Daniel Mills
2020-07-30 02:58:08 -04:00
parent 773dd2fd1a
commit aec5486144
14 changed files with 241 additions and 13 deletions

View File

@@ -124,7 +124,7 @@ public class IrisBiomeDecorator
double xx = dispersion.equals(Dispersion.SCATTER) ? nrng.i(-100000, 100000) : x;
double zz = dispersion.equals(Dispersion.SCATTER) ? nrng.i(-100000, 100000) : z;
if(getGenerator(nrng).fitDoubleD(0D, 1D, xx, zz) <= chance)
if(getGenerator(rng).fitDoubleD(0D, 1D, xx, zz) <= chance)
{
try
{

View File

@@ -54,6 +54,30 @@ public class IrisDimension extends IrisRegistrant
@Desc("Generate caves or not.")
private boolean caves = true;
@DontObfuscate
@Desc("Carve terrain or not")
private double carvingZoom = 3.5;
@DontObfuscate
@Desc("Carving starts at this height")
private int carvingMin = 115;
@DontObfuscate
@Desc("The maximum height carving happens at")
private int carvingMax = 239;
@DontObfuscate
@Desc("The thickness of carvings (vertical)")
private double carvingSliverThickness = 5.5D;
@DontObfuscate
@Desc("The thickness of ripples on carved walls")
private double carvingRippleThickness = 3D;
@DontObfuscate
@Desc("How much of 3D space is carved out. Higher values make carvings cross into 3d space more often (bigger)")
private double carvingEnvelope = 0.335D;
@DontObfuscate
@Desc("Carve terrain or not")
private boolean carving = true;

View File

@@ -77,9 +77,17 @@ public class AtomicRegionData
return data;
}
ByteArrayTag btag = (ByteArrayTag) tag.get(rx + "." + rz);
ByteArrayInputStream in = new ByteArrayInputStream(btag.getValue());
data.read(in);
try
{
ByteArrayTag btag = (ByteArrayTag) tag.get(rx + "." + rz);
ByteArrayInputStream in = new ByteArrayInputStream(btag.getValue());
data.read(in);
}
catch(Throwable e)
{
}
return data;
}

View File

@@ -3,6 +3,7 @@ package com.volmit.iris.object.atomics;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.concurrent.locks.ReentrantLock;
import org.bukkit.Material;
import org.bukkit.block.Biome;
@@ -25,6 +26,7 @@ public class AtomicSliver
private KMap<Integer, BlockData> block;
private KMap<Integer, IrisBiome> truebiome;
private KMap<Integer, Biome> biome;
private ReentrantLock lock = new ReentrantLock();
private int highestBlock = 0;
private int highestBiome = 0;
private long last = M.ms();
@@ -65,8 +67,17 @@ public class AtomicSliver
return;
}
lock.lock();
block.put(h, d);
if(d.getMaterial().equals(Material.AIR) || d.getMaterial().equals(Material.CAVE_AIR))
{
lock.unlock();
return;
}
highestBlock = h > highestBlock ? h : highestBlock;
lock.unlock();
}
public void setSilently(int h, BlockData d)
@@ -76,7 +87,9 @@ public class AtomicSliver
return;
}
lock.lock();
block.put(h, d);
lock.unlock();
}
public boolean isSolid(int h)
@@ -98,17 +111,22 @@ public class AtomicSliver
public void set(int h, Biome d)
{
lock.lock();
biome.put(h, d);
highestBiome = h > highestBiome ? h : highestBiome;
lock.unlock();
}
public void set(int h, IrisBiome d)
{
lock.lock();
truebiome.put(h, d);
lock.unlock();
}
public void write(ChunkData d)
{
lock.lock();
for(int i = 0; i <= highestBlock; i++)
{
if(block.get(i) == null)
@@ -121,10 +139,12 @@ public class AtomicSliver
d.setBlock(x, i, z, block.get(i));
}
}
lock.unlock();
}
public void write(BiomeGrid d)
{
lock.lock();
for(int i = 0; i <= highestBiome; i++)
{
if(biome.get(i) != null)
@@ -132,15 +152,19 @@ public class AtomicSliver
d.setBiome(x, i, z, biome.get(i));
}
}
lock.unlock();
}
public void write(HeightMap height)
{
lock.lock();
height.setHeight(x, z, highestBlock);
lock.unlock();
}
public void read(DataInputStream din) throws IOException
{
lock.lock();
this.block = new KMap<Integer, BlockData>();
int h = din.readByte() - Byte.MIN_VALUE;
highestBlock = h;
@@ -149,10 +173,12 @@ public class AtomicSliver
{
block.put(i, BlockDataTools.getBlockData(din.readUTF()));
}
lock.unlock();
}
public void write(DataOutputStream dos) throws IOException
{
lock.lock();
dos.writeByte(highestBlock + Byte.MIN_VALUE);
for(int i = 0; i <= highestBlock; i++)
@@ -160,10 +186,12 @@ public class AtomicSliver
BlockData dat = block.get(i);
dos.writeUTF((dat == null ? AIR : dat).getAsString(true));
}
lock.unlock();
}
public void insert(AtomicSliver atomicSliver)
{
lock.lock();
for(int i = 0; i < 256; i++)
{
if(block.get(i) == null || block.get(i).equals(AIR))
@@ -177,10 +205,12 @@ public class AtomicSliver
block.put(i, b);
}
}
lock.unlock();
}
public void inject(ChunkData currentData)
{
lock.lock();
for(int i = 0; i < 256; i++)
{
if(block.get(i) != null && !block.get(i).equals(AIR))
@@ -189,6 +219,7 @@ public class AtomicSliver
currentData.setBlock(x, i, z, b);
}
}
lock.unlock();
}
public boolean isOlderThan(long m)