Support for Incendium's inverted trees
Closed this issue · 6 comments
Describe the feature
Incendium adds an Inverted Forest biome to the Nether, which generates upside-down Huge Warped Fungi hanging from the Nether ceiling. These use Warped Wart Blocks as their leaves, growing at the bottom of the trunk. They also often, but not always, have large amounts of Warped Wart Blocks at the top of the trunk, comprising part of the ceiling.
Currently, when trying to cut down these trees (with detection mode set to WHOLE_TREE), FallingTree interprets the Warped Wart Blocks at the top of the trunk as the "leaves" of the tree. This means that when a tree is cut, large amounts of the ceiling often fall along with it. This behaviour appears to be quite inconsistent; often, parts of the trunk or leaves of the tree will not be felled and be left hanging in place.
Additionally, if the block at the top of the trunk happens to be Netherrack, with no surrounding wart blocks the tree will not be felled at all as FallingTree does not consider it to be a tree.
Proposed fix
The simplest method of supporting these inverted trees would simply to allow a list of "inverted trees" biomes (or even a biome tag) to be specified in the config. While in any of those biomes, FallingTree's tree detection logic should be inverted, checking the bottom of the tree for leaves instead of the top, and inverting the direction of detection modes ABOVE_CUT and ABOVE_Y. Additionally, it would be good for the top few logs of these inverted trees to ignore any "leaves" surrounding them, to avoid misidentifying parts of the roof as leaves.
Description
This behaviour appears to be quite inconsistent; often, parts of the trunk or leaves of the tree will not be felled and be left hanging in place.
Are you on the latest version? This sounds like #861
Additionally, if the block at the top of the trunk happens to be Netherrack, with no surrounding wart blocks the tree will not be felled at all as FallingTree does not consider it to be a tree.
Yeah, as you probably have the "leaves around required" settign set to a non 0 value (the default).
Proposed fix
The simplest method of supporting these inverted trees would simply to allow a list of "inverted trees" biomes (or even a biome tag) to be specified in the config.
I agree with that. I don't want to add any specific related mod logic into FalligTree, so something through the config seems fit.
Why ? Simply because I don't wanna maintain a list of all the mod biomes where that should apply. The player should do that through the config (same as extra logs, leaves, ...).
While in any of those biomes, FallingTree's tree detection logic should be inverted, checking the bottom of the tree for leaves instead of the top, and inverting the direction of detection modes ABOVE_CUT and ABOVE_Y.
Not sure I fully agree on that part. The thing is "inverting the logic" is nice in that case, but may not be accurate in another context. Like maybe someone will come with a biome where trees grows towards the left. And so all the logic that will be implement for "downwards" will be unusable for other cases.
A better way is probably to add the detection modes "WHOLE_TREE_DOWNWARDS", "BELOW CUT" & "BELOW_Y" ; and the new field in the configuration would allow to override detection mode for given biomes.
Maybe could be something like :
{
"trees": {
"detection_mode" : "WHOLE_TREE",
"detection_mode_biome_override": {
"mod1:biome1": "WHOLE_TREE_DOWNWARDS",
"mod2:biome3": "BELOW_Y"
}
}
}I don't really know if it can be displayed easily through cloth-config though. But as it's an advanced setting, I guess I can be accessible only through editing the file.
Additionally, it would be good for the top few logs of these inverted trees to ignore any "leaves" surrounding them, to avoid misidentifying parts of the roof as leaves.
That part is a bit tricky. The way trees are scanned there is no order between the trunk and leaves. So maybe some leaves will have started to be scanned before the full trunk is detected, and so before we can ignore the x lowest logs for leaves.
On top of that, some leaves may fall back down to the ground and connect to it, making it a big fluff.
I think to mitigate this, BELOW_Y should be used. It'll force you to aim at the base of the trunk, but I guess it's a rather acceptable compromise, "aim well to get the easy breaking"
What do you think of this ? Basically adding the new detection modes as well as the override per biome in the config. Would that allow you to do what you want ?
Description
Are you on the latest version? This sounds like #861
I'm using FallingTree-1.21.1-1.21.1.7. I'm not seeing random single blocks left behind when cutting down ordinary trees; I'm seeing larger (around 3-to-12 block) sections of the trunk left behind ONLY when cutting the inverted trees. I'm also using FALL_BLOCK, not FALL_ITEM.
Hopefully this issue will go away on its own if these new features are implemented.
Proposed fix
What do you think of this ? Basically adding the new detection modes as well as the override per biome in the config. Would that allow you to do what you want ?
All of your suggestions make sense, and if implemented would allow me to do what I want. Thanks for taking a look at the issue!
FallingTree-1.21.1-1.21.1.7
Ah yeah 1.21.1. It is quite buggy. The issue should happen on it on every tree at random times. 1.21.1.2 is way more stable.
I just didn't back port all the fixes cause the version is old but feels like I'll have to as many people use it.
All of your suggestions make sense, and if implemented would allow me to do what I want. Thanks for taking a look at the issue!
Okay, I don't know when I'll work on it but i'll try to have it out in not too too long.
What I proposed have been implemented. I didn't have the time to test it though, so I'll leave it here for now in case you wanna test early.
You can download it here for the next few days (mod is inside the zip file) : https://github.com/RakambdaOrg/FallingTree/actions/runs/15363230087
I've tested the build: it appears to partially work.
The new "BELOW" tree detection methods work correctly when selected as the main detection mode. However, biome overrides don't seem to work. Adding this to the config file:
"detectionModeBiomeOverride": {
"incendium:inverted_forest": "BELOW_CUT"
}causes the FallingTree mod to stop working entirely while I'm in an Inverted Forest biome.
