diff --git a/src/main/java/ru/betterend/world/features/DefaultFeature.java b/src/main/java/ru/betterend/world/features/DefaultFeature.java index 631226ac..92621d42 100644 --- a/src/main/java/ru/betterend/world/features/DefaultFeature.java +++ b/src/main/java/ru/betterend/world/features/DefaultFeature.java @@ -21,6 +21,10 @@ public abstract class DefaultFeature extends Feature { 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) { int h = BlocksHelper.downRay(world, pos, 256); return pos.down(h); diff --git a/src/main/java/ru/betterend/world/features/EndLakeFeature.java b/src/main/java/ru/betterend/world/features/EndLakeFeature.java index 5cef3929..c3ce3ebc 100644 --- a/src/main/java/ru/betterend/world/features/EndLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/EndLakeFeature.java @@ -28,7 +28,7 @@ public class EndLakeFeature extends DefaultFeature { int dist = MHelper.floor(radius); int dist2 = MHelper.floor(radius * 1.5); int bott = MHelper.floor(depth); - blockPos = getPosOnSurface(world, blockPos); + blockPos = getPosOnSurfaceWG(world, blockPos); if (blockPos.getY() < 10) return false; int waterLevel = blockPos.getY(); @@ -65,7 +65,7 @@ public class EndLakeFeature extends DefaultFeature { r *= r; if (x2 + z2 <= r) { 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); } pos = POS.down(); @@ -79,13 +79,11 @@ public class EndLakeFeature extends DefaultFeature { else BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.ENDSTONE_DUST.getDefaultState()); } - pos = POS.up(); - if (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND)) { - while (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND)) { - BlocksHelper.setWithoutUpdate(world, pos, AIR); - pos = pos.up(); - } - } + /*pos = POS.up(); + while (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND) || !state.canPlaceAt(world, pos) || state.getBlock() == BlockRegistry.ENDSTONE_DUST) { + BlocksHelper.setWithoutUpdate(world, pos, AIR); + pos = pos.up(); + }*/ } } } @@ -110,7 +108,7 @@ public class EndLakeFeature extends DefaultFeature { rb *= rb; if (y2 + x2 + z2 <= r) { 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); } pos = POS.down(); diff --git a/src/main/java/ru/betterend/world/features/ScatterFeature.java b/src/main/java/ru/betterend/world/features/ScatterFeature.java index 7e76cf5b..9fcd1899 100644 --- a/src/main/java/ru/betterend/world/features/ScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/ScatterFeature.java @@ -26,13 +26,16 @@ public abstract class ScatterFeature extends DefaultFeature { @Override 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) { return false; } 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);