Remove Ceiling Gen & Post Block Sep

This commit is contained in:
Daniel Mills
2020-08-16 22:08:57 -04:00
parent 81f6ce26d4
commit af22751210
14 changed files with 137 additions and 291 deletions

View File

@@ -1,6 +1,7 @@
package com.volmit.iris.gen.post;
import org.bukkit.block.data.BlockData;
import org.bukkit.generator.ChunkGenerator.ChunkData;
import com.volmit.iris.gen.PostBlockChunkGenerator;
import com.volmit.iris.util.B;
@@ -22,7 +23,7 @@ public class PostFloatingNibDeleter extends IrisPostBlockFilter
}
@Override
public void onPost(int x, int z)
public void onPost(int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
{
int g = 0;
int h = highestTerrainBlock(x, z);
@@ -41,13 +42,13 @@ public class PostFloatingNibDeleter extends IrisPostBlockFilter
g += hc < h - 1 ? 1 : 0;
g += hd < h - 1 ? 1 : 0;
if(g == 4 && isAir(x, h - 1, z))
if(g == 4 && isAir(x, h - 1, z, currentPostX, currentPostZ, currentData))
{
setPostBlock(x, h, z, AIR);
setPostBlock(x, h, z, AIR, currentPostX, currentPostZ, currentData);
for(int i = h - 1; i > 0; i--)
{
if(!isAir(x, i, z))
if(!isAir(x, i, z, currentPostX, currentPostZ, currentData))
{
updateHeight(x, z, i);
break;

View File

@@ -2,6 +2,7 @@ package com.volmit.iris.gen.post;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.generator.ChunkGenerator.ChunkData;
import com.volmit.iris.gen.PostBlockChunkGenerator;
import com.volmit.iris.util.IrisPostBlockFilter;
@@ -20,7 +21,7 @@ public class PostNibSmoother extends IrisPostBlockFilter
}
@Override
public void onPost(int x, int z)
public void onPost(int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
{
int g = 0;
int h = highestTerrainBlock(x, z);
@@ -35,13 +36,13 @@ public class PostNibSmoother extends IrisPostBlockFilter
if(g >= 3)
{
BlockData bc = getPostBlock(x, h, z);
BlockData b = getPostBlock(x, h + 1, z);
BlockData bc = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
BlockData b = getPostBlock(x, h + 1, z, currentPostX, currentPostZ, currentData);
Material m = bc.getMaterial();
if(m.isSolid())
{
setPostBlock(x, h, z, b);
setPostBlock(x, h, z, b, currentPostX, currentPostZ, currentData);
updateHeight(x, z, h - 1);
}
}

View File

@@ -1,5 +1,7 @@
package com.volmit.iris.gen.post;
import org.bukkit.generator.ChunkGenerator.ChunkData;
import com.volmit.iris.gen.PostBlockChunkGenerator;
import com.volmit.iris.util.IrisPostBlockFilter;
@@ -17,7 +19,7 @@ public class PostPotholeFiller extends IrisPostBlockFilter
}
@Override
public void onPost(int x, int z)
public void onPost(int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
{
int g = 0;
int h = highestTerrainBlock(x, z);
@@ -32,7 +34,7 @@ public class PostPotholeFiller extends IrisPostBlockFilter
if(g >= 3)
{
setPostBlock(x, h + 1, z, getPostBlock(x, h, z));
setPostBlock(x, h + 1, z, getPostBlock(x, h, z, currentPostX, currentPostZ, currentData), currentPostX, currentPostZ, currentData);
updateHeight(x, z, h + 1);
}
}

View File

@@ -2,6 +2,7 @@ package com.volmit.iris.gen.post;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.generator.ChunkGenerator.ChunkData;
import com.volmit.iris.gen.PostBlockChunkGenerator;
import com.volmit.iris.util.IrisPostBlockFilter;
@@ -26,7 +27,7 @@ public class PostSlabber extends IrisPostBlockFilter
}
@Override
public void onPost(int x, int z)
public void onPost(int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
{
int h = highestTerrainBlock(x, z);
int ha = highestTerrainBlock(x + 1, z);
@@ -34,7 +35,7 @@ public class PostSlabber extends IrisPostBlockFilter
int hc = highestTerrainBlock(x - 1, z);
int hd = highestTerrainBlock(x, z - 1);
if((ha == h + 1 && isSolid(x + 1, ha, z)) || (hb == h + 1 && isSolid(x, hb, z + 1)) || (hc == h + 1 && isSolid(x - 1, hc, z)) || (hd == h + 1 && isSolid(x, hd, z - 1)))
if((ha == h + 1 && isSolid(x + 1, ha, z, currentPostX, currentPostZ, currentData)) || (hb == h + 1 && isSolid(x, hb, z + 1, currentPostX, currentPostZ, currentData)) || (hc == h + 1 && isSolid(x - 1, hc, z, currentPostX, currentPostZ, currentData)) || (hd == h + 1 && isSolid(x, hd, z - 1, currentPostX, currentPostZ, currentData)))
{
BlockData d = gen.sampleTrueBiome(x, z).getBiome().getSlab().get(rng, x, h, z);
@@ -50,16 +51,16 @@ public class PostSlabber extends IrisPostBlockFilter
return;
}
if(isSnowLayer(x, h, z))
if(isSnowLayer(x, h, z, currentPostX, currentPostZ, currentData))
{
return;
}
if(isAirOrWater(x, h + 2, z))
if(isAirOrWater(x, h + 2, z, currentPostX, currentPostZ, currentData))
{
queue(() ->
{
setPostBlock(x, h + 1, z, d);
setPostBlock(x, h + 1, z, d, currentPostX, currentPostZ, currentData);
updateHeight(x, z, h + 1);
});
}

View File

@@ -2,6 +2,7 @@ package com.volmit.iris.gen.post;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.generator.ChunkGenerator.ChunkData;
import com.volmit.iris.gen.PostBlockChunkGenerator;
import com.volmit.iris.object.IrisBiome;
@@ -26,7 +27,7 @@ public class PostWallPatcher extends IrisPostBlockFilter
}
@Override
public void onPost(int x, int z)
public void onPost(int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
{
IrisBiome biome = gen.sampleTrueBiome(x, z).getBiome();
int h, ha, hb, hc, hd;
@@ -48,7 +49,7 @@ public class PostWallPatcher extends IrisPostBlockFilter
{
if(!s.getMaterial().equals(AIR))
{
setPostBlock(x, h + 1, z, s);
setPostBlock(x, h + 1, z, s, currentPostX, currentPostZ, currentData);
updateHeight(x, z, h + 1);
}
}
@@ -64,12 +65,12 @@ public class PostWallPatcher extends IrisPostBlockFilter
continue;
}
if(isAirOrWater(x, i, z))
if(isAirOrWater(x, i, z, currentPostX, currentPostZ, currentData))
{
continue;
}
setPostBlock(x, i, z, d);
setPostBlock(x, i, z, d, currentPostX, currentPostZ, currentData);
}
}
}

View File

@@ -3,6 +3,7 @@ package com.volmit.iris.gen.post;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.generator.ChunkGenerator.ChunkData;
import com.volmit.iris.gen.PostBlockChunkGenerator;
import com.volmit.iris.util.B;
@@ -24,10 +25,10 @@ public class PostWaterlogger extends IrisPostBlockFilter
}
@Override
public void onPost(int x, int z)
public void onPost(int x, int z, int currentPostX, int currentPostZ, ChunkData currentData)
{
int h = highestTerrainBlock(x, z);
BlockData b = getPostBlock(x, h, z);
BlockData b = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
if(b instanceof Waterlogged)
{
@@ -38,24 +39,24 @@ public class PostWaterlogger extends IrisPostBlockFilter
return;
}
if(isWaterOrWaterlogged(x, h + 1, z) && !ww.isWaterlogged())
if(isWaterOrWaterlogged(x, h + 1, z, currentPostX, currentPostZ, currentData) && !ww.isWaterlogged())
{
ww.setWaterlogged(true);
setPostBlock(x, h, z, ww);
setPostBlock(x, h, z, ww, currentPostX, currentPostZ, currentData);
}
else if(!ww.isWaterlogged() && (isWaterOrWaterlogged(x + 1, h, z) || isWaterOrWaterlogged(x - 1, h, z) || isWaterOrWaterlogged(x, h, z + 1) || isWaterOrWaterlogged(x, h, z - 1)))
else if(!ww.isWaterlogged() && (isWaterOrWaterlogged(x + 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x - 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z + 1, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z - 1, currentPostX, currentPostZ, currentData)))
{
ww.setWaterlogged(true);
setPostBlock(x, h, z, ww);
setPostBlock(x, h, z, ww, currentPostX, currentPostZ, currentData);
}
}
else if(b.getMaterial().equals(Material.AIR) && h <= gen.getFluidHeight())
{
if((isWaterOrWaterlogged(x + 1, h, z) || isWaterOrWaterlogged(x - 1, h, z) || isWaterOrWaterlogged(x, h, z + 1) || isWaterOrWaterlogged(x, h, z - 1)))
if((isWaterOrWaterlogged(x + 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x - 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z + 1, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z - 1, currentPostX, currentPostZ, currentData)))
{
setPostBlock(x, h, z, WATER);
setPostBlock(x, h, z, WATER, currentPostX, currentPostZ, currentData);
}
}
}