added feature appender/prepender for simple adds

This commit is contained in:
dags- 2020-06-20 15:55:08 +01:00
parent 0423925e17
commit ef0fbb7c7f
4 changed files with 19 additions and 19 deletions

View File

@ -69,10 +69,18 @@ public class BushFeature extends Feature<BushFeature.Config> {
private boolean place(IWorld world, BlockPos.Mutable center, BlockPos.Mutable pos, Random random, Config config) { 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())); center.setY(world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, center.getX(), center.getZ()));
// don't replace solid blocks
if (BlockUtils.isSolid(world, center)) { if (BlockUtils.isSolid(world, center)) {
return false; 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); world.setBlockState(center, config.trunk, 2);
for (Vec3i neighbour : leaves) { for (Vec3i neighbour : leaves) {

View File

@ -2,12 +2,8 @@
"biomes": [ "biomes": [
"terraforged:cold_steppe" "terraforged:cold_steppe"
], ],
"match": [ "stage": "VEGETAL_DECORATION",
[ "prepend": {
"minecraft:grass"
]
],
"before": {
"name": "minecraft:decorated", "name": "minecraft:decorated",
"config": { "config": {
"feature": { "feature": {

View File

@ -4,12 +4,8 @@
"terraforged:savanna_scrub", "terraforged:savanna_scrub",
"terraforged:shattered_savanna_scrub" "terraforged:shattered_savanna_scrub"
], ],
"match": [ "stage": "VEGETAL_DECORATION",
[ "prepend": {
"minecraft:grass"
]
],
"before": {
"name": "minecraft:decorated", "name": "minecraft:decorated",
"config": { "config": {
"feature": { "feature": {

View File

@ -1,13 +1,13 @@
{ {
"biomes": [ "biomes": [
"terraforged:taiga_scrub" "minecraft:snowy_tundra",
"minecraft:taiga",
"minecraft:taiga_hills",
"terraforged:taiga_scrub",
"terraforged:snowy_taiga_scrub"
], ],
"match": [ "stage": "VEGETAL_DECORATION",
[ "prepend": {
"minecraft:grass"
]
],
"before": {
"name": "minecraft:decorated", "name": "minecraft:decorated",
"config": { "config": {
"feature": { "feature": {