Bugfixes for 13

This commit is contained in:
Daniel Mills 2020-10-16 09:50:27 -04:00
parent b9a447453f
commit 4ccfa8c3b6
2 changed files with 24 additions and 4 deletions

View File

@ -81,6 +81,7 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
public ContextualTerrainProvider(TerrainTarget target) public ContextualTerrainProvider(TerrainTarget target)
{ {
metrics = new IrisMetrics(256);
warnings = new KSet<>(); warnings = new KSet<>();
this.target = target; this.target = target;
pushLatch = new ChronoLatch(3000); pushLatch = new ChronoLatch(3000);

View File

@ -100,7 +100,7 @@ public class AtomicSliver
public BlockData getOrNull(int h) public BlockData getOrNull(int h)
{ {
if(forgetful) if(forgetful || oob(h))
{ {
return null; return null;
} }
@ -117,7 +117,7 @@ public class AtomicSliver
public void set(int h, BlockData d) public void set(int h, BlockData d)
{ {
if(forgetful) if(forgetful || oob(h))
{ {
return; return;
} }
@ -138,7 +138,11 @@ public class AtomicSliver
if(d == null) if(d == null)
{ {
Iris.warn("Null set at " + h + " of " + x + " " + z); return;
}
if(oob(h))
{
return; return;
} }
@ -159,13 +163,28 @@ public class AtomicSliver
lock.unlock(); lock.unlock();
} }
private boolean oob(int h)
{
return h > 255 || h < 0;
}
public boolean isSolid(int h) public boolean isSolid(int h)
{ {
if(oob(h))
{
return false;
}
return getType(h).isSolid(); return getType(h).isSolid();
} }
public void set(int h, Biome d) public void set(int h, Biome d)
{ {
if(oob(h))
{
return;
}
lock.lock(); lock.lock();
if(Iris.biome3d) if(Iris.biome3d)