Fix holes and crap

This commit is contained in:
Daniel Mills 2020-10-28 01:28:43 -04:00
parent 6a03b4b125
commit f1856afa77

View File

@ -1,6 +1,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.block.data.type.Slab;
import org.bukkit.block.data.type.Slab.Type;
@ -18,8 +19,8 @@ import com.volmit.iris.util.RNG;
public class PostMasterPatcher extends IrisPostBlockFilter
{
private static final FastBlockData WATER = B.getBlockData("WATER");
private static final FastBlockData AIR = B.getBlockData("AIR");
private static final BlockData WATER = B.getBlockData("WATER");
private static final BlockData AIR = B.getBlockData("AIR");
private final RNG rng;
@DontObfuscate
@ -79,17 +80,20 @@ public class PostMasterPatcher extends IrisPostBlockFilter
g += hc == h - 1 ? 1 : 0;
g += hd == h - 1 ? 1 : 0;
if(g >= 3)
if(g >= 4)
{
FastBlockData bc = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
FastBlockData b = getPostBlock(x, h + 1, z, currentPostX, currentPostZ, currentData);
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())
if((b.getMaterial().isOccluding() && b.getMaterial().isSolid()))
{
setPostBlock(x, h, z, b, currentPostX, currentPostZ, currentData);
updateHeight(x, z, h - 1);
h--;
if(m.isSolid())
{
setPostBlock(x, h, z, b, currentPostX, currentPostZ, currentData);
updateHeight(x, z, h - 1);
h--;
}
}
}
@ -102,12 +106,12 @@ public class PostMasterPatcher extends IrisPostBlockFilter
g += hc == h + 1 ? 1 : 0;
g += hd == h + 1 ? 1 : 0;
if(g >= 3)
if(g >= 4)
{
FastBlockData ba = getPostBlock(x, ha, z, currentPostX, currentPostZ, currentData);
FastBlockData bb = getPostBlock(x, hb, z, currentPostX, currentPostZ, currentData);
FastBlockData bc = getPostBlock(x, hc, z, currentPostX, currentPostZ, currentData);
FastBlockData bd = getPostBlock(x, hd, z, currentPostX, currentPostZ, currentData);
BlockData ba = getPostBlock(x, ha, z, currentPostX, currentPostZ, currentData);
BlockData bb = getPostBlock(x, hb, z, currentPostX, currentPostZ, currentData);
BlockData bc = getPostBlock(x, hc, z, currentPostX, currentPostZ, currentData);
BlockData bd = getPostBlock(x, hd, z, currentPostX, currentPostZ, currentData);
g = 0;
g = B.isSolid(ba) ? g + 1 : g;
g = B.isSolid(bb) ? g + 1 : g;
@ -137,7 +141,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
for(int i = h; i > h - max; i--)
{
FastBlockData d = biome.getWall().get(rng, x + i, i + h, z + i, gen.getData());
BlockData d = biome.getWall().get(rng, x + i, i + h, z + i, gen.getData());
if(d != null)
{
@ -169,7 +173,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
|| (hd == h + 1 && isSolidNonSlab(x, hd, z - 1, currentPostX, currentPostZ, currentData)))
//@done
{
FastBlockData d = biome.getSlab().get(rng, x, h, z, gen.getData());
BlockData d = biome.getSlab().get(rng, x, h, z, gen.getData());
if(d != null)
{
@ -201,11 +205,11 @@ public class PostMasterPatcher extends IrisPostBlockFilter
}
// Waterlogging
FastBlockData b = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
BlockData b = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
if(b.getBlockData() instanceof Waterlogged)
if(b instanceof Waterlogged)
{
Waterlogged ww = (Waterlogged) b.getBlockData();
Waterlogged ww = (Waterlogged) b;
boolean w = false;
if(isWaterOrWaterlogged(x, h + 1, z, currentPostX, currentPostZ, currentData))
{
@ -276,9 +280,9 @@ public class PostMasterPatcher extends IrisPostBlockFilter
g += fc == f - 1 ? 1 : 0;
g += fd == f - 1 ? 1 : 0;
if(g >= 3)
if(g >= 4)
{
FastBlockData bc = getPostBlock(x, f, z, currentPostX, currentPostZ, currentData);
BlockData bc = getPostBlock(x, f, z, currentPostX, currentPostZ, currentData);
b = getPostBlock(x, f + 1, z, currentPostX, currentPostZ, currentData);
Material m = bc.getMaterial();
@ -299,19 +303,19 @@ public class PostMasterPatcher extends IrisPostBlockFilter
g += fc == f + 1 ? 1 : 0;
g += fd == f + 1 ? 1 : 0;
if(g >= 3)
if(g >= 4)
{
FastBlockData ba = getPostBlock(x, fa, z, currentPostX, currentPostZ, currentData);
FastBlockData bb = getPostBlock(x, fb, z, currentPostX, currentPostZ, currentData);
FastBlockData bc = getPostBlock(x, fc, z, currentPostX, currentPostZ, currentData);
FastBlockData bd = getPostBlock(x, fd, z, currentPostX, currentPostZ, currentData);
BlockData ba = getPostBlock(x, fa, z, currentPostX, currentPostZ, currentData);
BlockData bb = getPostBlock(x, fb, z, currentPostX, currentPostZ, currentData);
BlockData bc = getPostBlock(x, fc, z, currentPostX, currentPostZ, currentData);
BlockData bd = getPostBlock(x, fd, z, currentPostX, currentPostZ, currentData);
g = 0;
g = B.isSolid(ba) ? g + 1 : g;
g = B.isSolid(bb) ? g + 1 : g;
g = B.isSolid(bc) ? g + 1 : g;
g = B.isSolid(bd) ? g + 1 : g;
if(g >= 3)
if(g >= 4)
{
setPostBlock(x, f + 1, z, getPostBlock(x, f, z, currentPostX, currentPostZ, currentData), currentPostX, currentPostZ, currentData);
updateHeight(x, z, f + 1);
@ -329,7 +333,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
|| (fd == f + 1 && isSolidNonSlab(x, fd, z - 1, currentPostX, currentPostZ, currentData)))
//@done
{
FastBlockData d = cave.getSlab().get(rng, x, f, z, gen.getData());
BlockData d = cave.getSlab().get(rng, x, f, z, gen.getData());
if(d != null)
{
@ -364,7 +368,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
|| (cd == c - 1 && isSolidNonSlab(x, cd, z - 1, currentPostX, currentPostZ, currentData)))
//@done
{
FastBlockData d = cave.getSlab().get(rng, x, c, z, gen.getData());
BlockData d = cave.getSlab().get(rng, x, c, z, gen.getData());
if(d != null)
{
@ -375,7 +379,7 @@ public class PostMasterPatcher extends IrisPostBlockFilter
cancel = true;
}
if(!(d.getBlockData() instanceof Slab))
if(!(d instanceof Slab))
{
cancel = true;
}
@ -387,9 +391,9 @@ public class PostMasterPatcher extends IrisPostBlockFilter
if(!cancel && isAirOrWater(x, c, z, currentPostX, currentPostZ, currentData))
{
Slab slab = (Slab) d.getBlockData().clone();
Slab slab = (Slab) d.clone();
slab.setType(Type.TOP);
setPostBlock(x, c, z, d, currentPostX, currentPostZ, currentData);
setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
}
}
}