mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Attempt to fix stilting
This commit is contained in:
parent
286c4da2f3
commit
b201cf1990
@ -335,6 +335,8 @@ public class IrisObject extends IrisRegistrant
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lowest = Integer.MAX_VALUE;
|
||||||
|
|
||||||
for(BlockVector g : blocks.keySet())
|
for(BlockVector g : blocks.keySet())
|
||||||
{
|
{
|
||||||
BlockVector i = g.clone();
|
BlockVector i = g.clone();
|
||||||
@ -409,11 +411,17 @@ public class IrisObject extends IrisRegistrant
|
|||||||
placer.set(xx, yy, zz, data);
|
placer.set(xx, yy, zz, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(yy < lowest)
|
||||||
|
{
|
||||||
|
lowest = yy;
|
||||||
|
}
|
||||||
|
|
||||||
if(stilting)
|
if(stilting)
|
||||||
{
|
{
|
||||||
BlockData bdata = data;
|
BlockData bdata = data;
|
||||||
int yyy = yy;
|
int yyy = yy;
|
||||||
ChunkPosition ck = new ChunkPosition(xx, zz);
|
ChunkPosition ck = new ChunkPosition(xx, zz);
|
||||||
|
|
||||||
lowmap.compute(ck, (k, v) ->
|
lowmap.compute(ck, (k, v) ->
|
||||||
{
|
{
|
||||||
if(v == null)
|
if(v == null)
|
||||||
@ -437,20 +445,23 @@ public class IrisObject extends IrisRegistrant
|
|||||||
{
|
{
|
||||||
for(ChunkPosition i : lowmap.keySet())
|
for(ChunkPosition i : lowmap.keySet())
|
||||||
{
|
{
|
||||||
int xf = i.getX();
|
|
||||||
int yf = lowmap.get(i);
|
int yf = lowmap.get(i);
|
||||||
|
|
||||||
|
if(yf > lowest)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int xf = i.getX();
|
||||||
int zf = i.getZ();
|
int zf = i.getZ();
|
||||||
int yg = Math.floorDiv(h, 2) + placer.getHighest(xf, zf, config.isUnderwater());
|
int yg = Math.floorDiv(h, 2) + placer.getHighest(xf, zf, config.isUnderwater());
|
||||||
BlockData d = lowmapData.get(i);
|
BlockData d = lowmapData.get(i);
|
||||||
|
|
||||||
if(d != null)
|
if(d != null && !B.isAir(d))
|
||||||
{
|
{
|
||||||
for(int j = yf; j > yg - config.getOverStilt(); j--)
|
for(int j = yf; j > yg - config.getOverStilt(); j--)
|
||||||
{
|
{
|
||||||
if(!d.getMaterial().equals(Material.AIR) && !d.getMaterial().equals(Material.CAVE_AIR))
|
placer.set(xf, j, zf, d);
|
||||||
{
|
|
||||||
placer.set(xf, j, zf, d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,8 +460,8 @@ public class B
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAir(BlockData blockData)
|
public static boolean isAir(BlockData d)
|
||||||
{
|
{
|
||||||
return blockData.getMaterial().isAir();
|
return d.getMaterial().equals(Material.AIR) || d.getMaterial().equals(Material.CAVE_AIR) || d.getMaterial().equals(Material.VOID_AIR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user