From ef0fbb7c7f06bf2c220995f9b08a8695a164b6d0 Mon Sep 17 00:00:00 2001 From: dags- Date: Sat, 20 Jun 2020 15:55:08 +0100 Subject: [PATCH] added feature appender/prepender for simple adds --- .../terraforged/feature/feature/BushFeature.java | 8 ++++++++ .../features/shrubs/cold_steppe_bush.json | 8 ++------ .../terraforged/features/shrubs/steppe_bush.json | 8 ++------ .../features/shrubs/taiga_scrub_bush.json | 14 +++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/terraforged/feature/feature/BushFeature.java b/src/main/java/com/terraforged/feature/feature/BushFeature.java index 32ff7f4..aaa89e5 100644 --- a/src/main/java/com/terraforged/feature/feature/BushFeature.java +++ b/src/main/java/com/terraforged/feature/feature/BushFeature.java @@ -69,10 +69,18 @@ public class BushFeature extends Feature { private boolean place(IWorld world, BlockPos.Mutable center, BlockPos.Mutable pos, Random random, Config config) { center.setY(world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, center.getX(), center.getZ())); + // don't replace solid blocks if (BlockUtils.isSolid(world, center)) { return false; } + // only place on solid blocks + center.move(Direction.DOWN, 1); + if (!BlockUtils.isSolid(world, center)) { + return false; + } + + center.move(Direction.UP, 1); world.setBlockState(center, config.trunk, 2); for (Vec3i neighbour : leaves) { diff --git a/src/main/resources/data/terraforged/features/shrubs/cold_steppe_bush.json b/src/main/resources/data/terraforged/features/shrubs/cold_steppe_bush.json index a7953b2..725b4f8 100644 --- a/src/main/resources/data/terraforged/features/shrubs/cold_steppe_bush.json +++ b/src/main/resources/data/terraforged/features/shrubs/cold_steppe_bush.json @@ -2,12 +2,8 @@ "biomes": [ "terraforged:cold_steppe" ], - "match": [ - [ - "minecraft:grass" - ] - ], - "before": { + "stage": "VEGETAL_DECORATION", + "prepend": { "name": "minecraft:decorated", "config": { "feature": { diff --git a/src/main/resources/data/terraforged/features/shrubs/steppe_bush.json b/src/main/resources/data/terraforged/features/shrubs/steppe_bush.json index c443734..38fc441 100644 --- a/src/main/resources/data/terraforged/features/shrubs/steppe_bush.json +++ b/src/main/resources/data/terraforged/features/shrubs/steppe_bush.json @@ -4,12 +4,8 @@ "terraforged:savanna_scrub", "terraforged:shattered_savanna_scrub" ], - "match": [ - [ - "minecraft:grass" - ] - ], - "before": { + "stage": "VEGETAL_DECORATION", + "prepend": { "name": "minecraft:decorated", "config": { "feature": { diff --git a/src/main/resources/data/terraforged/features/shrubs/taiga_scrub_bush.json b/src/main/resources/data/terraforged/features/shrubs/taiga_scrub_bush.json index 7b2da8e..1162fb1 100644 --- a/src/main/resources/data/terraforged/features/shrubs/taiga_scrub_bush.json +++ b/src/main/resources/data/terraforged/features/shrubs/taiga_scrub_bush.json @@ -1,13 +1,13 @@ { "biomes": [ - "terraforged:taiga_scrub" + "minecraft:snowy_tundra", + "minecraft:taiga", + "minecraft:taiga_hills", + "terraforged:taiga_scrub", + "terraforged:snowy_taiga_scrub" ], - "match": [ - [ - "minecraft:grass" - ] - ], - "before": { + "stage": "VEGETAL_DECORATION", + "prepend": { "name": "minecraft:decorated", "config": { "feature": {