Fixes
This commit is contained in:
parent
0d0373a540
commit
a0aa8c929e
3 changed files with 17 additions and 12 deletions
|
@ -21,6 +21,10 @@ public abstract class DefaultFeature extends Feature<DefaultFeatureConfig> {
|
||||||
return world.getTopPosition(Type.WORLD_SURFACE, pos);
|
return world.getTopPosition(Type.WORLD_SURFACE, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected BlockPos getPosOnSurfaceWG(StructureWorldAccess world, BlockPos pos) {
|
||||||
|
return world.getTopPosition(Type.WORLD_SURFACE_WG, pos);
|
||||||
|
}
|
||||||
|
|
||||||
protected BlockPos getPosOnSurfaceRaycast(StructureWorldAccess world, BlockPos pos) {
|
protected BlockPos getPosOnSurfaceRaycast(StructureWorldAccess world, BlockPos pos) {
|
||||||
int h = BlocksHelper.downRay(world, pos, 256);
|
int h = BlocksHelper.downRay(world, pos, 256);
|
||||||
return pos.down(h);
|
return pos.down(h);
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class EndLakeFeature extends DefaultFeature {
|
||||||
int dist = MHelper.floor(radius);
|
int dist = MHelper.floor(radius);
|
||||||
int dist2 = MHelper.floor(radius * 1.5);
|
int dist2 = MHelper.floor(radius * 1.5);
|
||||||
int bott = MHelper.floor(depth);
|
int bott = MHelper.floor(depth);
|
||||||
blockPos = getPosOnSurface(world, blockPos);
|
blockPos = getPosOnSurfaceWG(world, blockPos);
|
||||||
if (blockPos.getY() < 10) return false;
|
if (blockPos.getY() < 10) return false;
|
||||||
|
|
||||||
int waterLevel = blockPos.getY();
|
int waterLevel = blockPos.getY();
|
||||||
|
@ -65,7 +65,7 @@ public class EndLakeFeature extends DefaultFeature {
|
||||||
r *= r;
|
r *= r;
|
||||||
if (x2 + z2 <= r) {
|
if (x2 + z2 <= r) {
|
||||||
state = world.getBlockState(POS);
|
state = world.getBlockState(POS);
|
||||||
if (state.isIn(BlockTagRegistry.END_GROUND) || !state.canPlaceAt(world, POS) || state.getBlock() == BlockRegistry.ENDSTONE_DUST) {
|
if (state.isIn(BlockTagRegistry.END_GROUND) || !state.canPlaceAt(world, POS) || state.getMaterial().equals(Material.PLANT)/* || state.getBlock() == BlockRegistry.ENDSTONE_DUST*/) {
|
||||||
BlocksHelper.setWithoutUpdate(world, POS, AIR);
|
BlocksHelper.setWithoutUpdate(world, POS, AIR);
|
||||||
}
|
}
|
||||||
pos = POS.down();
|
pos = POS.down();
|
||||||
|
@ -79,13 +79,11 @@ public class EndLakeFeature extends DefaultFeature {
|
||||||
else
|
else
|
||||||
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.ENDSTONE_DUST.getDefaultState());
|
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.ENDSTONE_DUST.getDefaultState());
|
||||||
}
|
}
|
||||||
pos = POS.up();
|
/*pos = POS.up();
|
||||||
if (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND)) {
|
while (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND) || !state.canPlaceAt(world, pos) || state.getBlock() == BlockRegistry.ENDSTONE_DUST) {
|
||||||
while (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND)) {
|
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
pos = pos.up();
|
||||||
pos = pos.up();
|
}*/
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +108,7 @@ public class EndLakeFeature extends DefaultFeature {
|
||||||
rb *= rb;
|
rb *= rb;
|
||||||
if (y2 + x2 + z2 <= r) {
|
if (y2 + x2 + z2 <= r) {
|
||||||
state = world.getBlockState(POS);
|
state = world.getBlockState(POS);
|
||||||
if (state.isIn(BlockTagRegistry.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getBlock() == BlockRegistry.ENDSTONE_DUST) {
|
if (state.isIn(BlockTagRegistry.END_GROUND) || !state.canPlaceAt(world, POS) || state.getBlock() == BlockRegistry.ENDSTONE_DUST) {
|
||||||
BlocksHelper.setWithoutUpdate(world, POS, y < waterLevel ? WATER : AIR);
|
BlocksHelper.setWithoutUpdate(world, POS, y < waterLevel ? WATER : AIR);
|
||||||
}
|
}
|
||||||
pos = POS.down();
|
pos = POS.down();
|
||||||
|
|
|
@ -26,13 +26,16 @@ public abstract class ScatterFeature extends DefaultFeature {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos center, DefaultFeatureConfig featureConfig) {
|
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos center, DefaultFeatureConfig featureConfig) {
|
||||||
center = getPosOnSurface(world, center);
|
center = getPosOnSurfaceWG(world, center);
|
||||||
|
|
||||||
if (center.getY() < 5) {
|
if (center.getY() < 5) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!world.getBlockState(center.down()).isIn(BlockTagRegistry.END_GROUND)) {
|
if (!world.getBlockState(center.down()).isIn(BlockTagRegistry.END_GROUND)) {
|
||||||
return false;
|
//center = getPosOnSurfaceRaycast(world, new BlockPos(center.getX(), 72, center.getZ()), 72);
|
||||||
|
//if (center.getY() < 5 || !world.getBlockState(center.down()).isIn(BlockTagRegistry.END_GROUND)) {
|
||||||
|
return false;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
float r = MHelper.randRange(radius * 0.5F, radius, random);
|
float r = MHelper.randRange(radius * 0.5F, radius, random);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue