TerraformersMC / Terrestria

A Fabric mod enhancing the detail of Minecraft with unique and vibrant biomes. Inspired by ExtrabiomesXL.
https://www.curseforge.com/minecraft/mc-mods/terrestria
GNU Lesser General Public License v3.0
201 stars 43 forks source link

Leaf piles from Sakura saplings are very destructive #181

Closed saltyseadoggo closed 3 years ago

saltyseadoggo commented 4 years ago

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 2020-10-03_15 23 43 2020-10-03_15 23 58 2020-10-03_15 27 36 2020-10-03_15 31 05

coderbot16 commented 4 years ago

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.

coderbot16 commented 3 years ago

Confirmed that this was fixed in the 1.16.3 Terrestria versions.