Pre-generated Leaves Incompatible
Kedree opened this issue ยท 4 comments
Hello, I built a very large modpack that strives to be vanilla as possible, and I am using the map named Grand Roost. It seems that either a mod or the map itself has made the vanilla leaves present in the pre-generated section of the world not detectable by the tree chop mod. I was able to work around this by turning off the "trees require leaves" setting, but that will introduce minor annoyances while building.
I can provide any necessary log files and I can even do some on the ground testing if desired, I haven't tested naturally generating trees yet. I have not added any mods that alter leaves or trees in any way but visuals and terrain generation (Cliffs and Trees, etc.)
The version is 1.21.1 (If there is a strict version requirement I spoofed it, but I do not remember needing to do that for this mod). The map was made in 1.20 I believe.
As a side note, Jade displays the total number of chops required, but it does not increment correctly while chopping and the log does not get thinner, is this a known incompatibility with a particular mod? Because if it is not, then that's another issue. Weirdly, after a certain number of chops (haven't counted, but I estimate between 5-10?) the block above the one that is being chopped converts into an "in progress chopping log" of the same thickness, for a really large tree I believe it even did it a third time. I suspect this has something to do with a mod and not the world itself. I can post pictures if desired.
Ahhh yes, I forgot about the persistent leaves setting!
This mostly fixed my issue! I still have to have "trees require leaves off"
Oops! That "trees require leaves" should behave the same consistent with or without ignorePersistentLeaves
. I'll look into the interaction between those two.
I am not sure why it misses some (leaf seeking distance is default at 7), perhaps its using the log seeking protocol instead of the leaf seeking one?
The detection method does change with ignorePersistentLeaves = false
because persistent leaves blocks don't store information about what tree they're connected to. So yeah, it ends up using a similar method to log detection, but 1) it only looks for leaves blocks and 2) it doesn't look diagonally for neighbors (mostly for performance reasons), which can definitely lead to floating leaves like you're seeing.
You could play with the config settings under compatibility.trees.problematicLeavesTrees
. When you chop a block in that logs
list, treechop will use a slower but more liberal search method for finding leaves, which (if I remember correctly) ignores persistent leaves and searches for diagonal neighbors.
Even if you don't have performance issues, there are usually gonna be some unintended consequences when stretching the detection rules, but it can help.
is it really not possible to add persistent leaves to the list of leaf-likes
It's not currently possible for treechop to do that because Minecraft treats "blocks" and "block states" differently. Persistent and non-persistent leaves are different "states" of the same block, but block tags don't differentiate between block states. But, I think I might be able to generalize the treechop block config logic to specify block states as well as blocks and block tags. No promises though, there are some extra complications with block states. I don't think there'd be any technical downsides to it.
Thanks for the video! Yeah, that's no good! Might be a compatibility issue, could you send your latest.log file so I can see your mods list? Or point me to a modpack if you're using one
the map itself has made the vanilla leaves present in the pre-generated section of the world not detectable by the tree chop mod
Leaves placed by players have a "persistent" flag set, and treechop ignores persistent leaves when "trees require leaves" is enabled. It sounds like the map creators placed persistent leaves instead of natural ones. I don't think there's any reliable way to get around this without creating more bugs. Ideally, map creators should place non-persistent leaves on their trees.
Toggling "trees require leaves" is annoying, but to make it less annoying I could add an option to enable/disable the option while sneaking.
Jade displays the total number of chops required, but it does not increment correctly while chopping
I'll look into this
after a certain number of chops (haven't counted, but I estimate between 5-10?) the block above the one that is being chopped converts into an "in progress chopping log" of the same thickness...
This is actually normal behavior. Each block can only hold 7 chops, so after 7 chops they start to spill to connected log blocks. I admit it's ugly. I'll think about how to make it more intuitive/visually responsive
Ahh, no worries! To be honest I do not see the benefit of a toggle trees require leaves option for my situation but more power to you! I think the 'annoyance' was not well conveyed, so I will clarify: your mod is awesome and works great, but the persistent leaves are a pain to remove manually (we have resorted to fire). The mapmaker even used fences for the trees, which would still remain regardless! While testing, I added fences to the list of choppables hoping that would fix it and forgot to remove it later when I realized it was most likely the leaves; imagine the confusion on my partner's face when their new fence was transformed into a block of wood through pitiful magic.
As for the connected log blocks, I actually like it! But that behavior in conjunction with the logs not changing size and the chop number not incrementing was just worrying. If it was unintentional, I thought it could give you a lead. Once again, great job so far! I've used many tree chopping mods throughout my many years of modded minecraft and I think I like this one the most, it's simple, unobtrusive, very vanilla, configurable, has a GUI, what more could you want?!
I JUST REALIZED YOU ALREADY HAVE A SETTING FOR PERSISTENT LEAVES. Would this not fix my issue entirely? I will try with this setting false and with require leaves on. I thought that was weird, the persistent flag/block state is literally only for leaves, I have not programmed in this space, so I didn't know if checking flag/block state was significantly harder/buggier than tags which seem easy from an outside perspective. Still confused as to why the logs do not shrink but alas.
#Non-decayable leaves are ignored when detecting leaves
ignorePersistentLeaves = true
-> ignorePersistentLeaves = false
This mostly fixed my issue! I still have to have "trees require leaves off" but when breaking the trees it gets most of the leaves! I am not sure why it misses some (leaf seeking distance is default at 7), perhaps its using the log seeking protocol instead of the leaf seeking one? I understand now where bugs can find their way in. There is already the capability to detect persistent leaves and it treats them as if they were logs it seems, is it really not possible to add persistent leaves to the list of leaf-likes? If it is possible what would be the downsides? The pros may outweight the cons for some and an option to toggle would be nice.
I added a video to help elucidate the log counting error, bug hunting is hard work, I hope this helps. (Sorry for the compression, had to hit 10 MB)