Leaf piles from Sakura saplings are very destructive
saltyseadoggo opened this issue ยท 2 comments
Expected Behaviour
The leaf piles generated by Sakura saplings when they grow would only be able to replace things that the player can place blocks over, such as grass or ferns.
Actual Behaviour
The leaf piles generated by Sakura saplings when they grow are very destructive in what blocks that they replace. I tested to confirm that they are able to replace torches, flower pots, bamboo saplings, buttons, pressure plates, signs, banners, redstone dust and lanterns, but they are likely to be able to replace many more.
Attachments
Oh, wow, that definitely is an oversight. Thanks for the report! It looks like https://github.com/TerraformersMC/Terrestria/blob/1.16/src/main/java/com/terraformersmc/terrestria/feature/tree/treedecorators/SakuraTreeDecorator.java#L37-L41 is the culprit:
//check for a solid block and place on top
if (world.getBlockState(mutable).isOpaque() || world.getFluidState(mutable).isIn(FluidTags.WATER)) {
world.setBlockState(mutable.up(), TerrestriaBlocks.SAKURA_LEAF_PILE.getDefaultState(), 3);
break;
}
Basically, it places a leaf pile on top of any opaque block, without checking if the above block can be replaced by trees (such as with canTreeReplace
). That would explain the behavior that you're seeing.