Do not include stripped logs as default logs
LucasVon opened this issue ยท 3 comments
Describe the feature
I'm not sure how this could be best implemented, so I think it's best if I explain the issue I'm having first.
The issue I've ran into is that any and all kinds of logs are whitelisted by default and that can't be changed with the adjacent blocks whitelist option. What this means is that if there's, for example, a stripped log adjacent to the tree, it will still cut the tree (or what the mod considers a tree).
For example, this is what my current whitelist config looks like:
"whitelistedAdjacentBlocks": ["minecraft:air", "#minecraft:leaves", "minecraft:vine", "minecraft:cocoa", "minecraft:dirt", "minecraft:grass", "minecraft:dark_oak_log", "minecraft:oak_log", "minecraft:acacia_log", "minecraft:birch_log", "minecraft:jungle_log", "minecraft:spruce_log"], /* What to do when an non whitelisted adjacent block is found. STOP_ALL will stop the search and nothing will be cut. STOP_BRANCH will stop the current branch only. The rest of the tree will be cut. */ "adjacentStopMode": "STOP_ALL"
What I'd expect this to do is to only allow the log blocks that are naturally generated as part of trees, and if it finds any player-made variation, like stripped and wood blocks, which I did not include in the whitelist, it would stop and not cut anything down. However, by default the game seems to consider any and all kinds of logs as whitelisted.
So one idea would be an option for the adjacent blocks whitelist to completely override the default whitelist, which would require the player that enables this option to create their own whitelist as I did.
Another would be to add a "strict mode", where if it's enabled the mod only allows adjacent blocks that can be naturally generated as part of trees.
The benefit of such a feature would be another way to tell apart natural trees and player-made structures, hopefully saving some bases from accidental obliteration.
Cheers!
As a general response:
To me it doesn't really make sense to have a "strict" list, or at least an adjacent list that doesn't contain the whitelisted leaves + logs. As they are what defines a tree, it is an adjacent block to a tree.
Now as for the original issue, this is because stripped logs are tagged as minecraft:logs
by minecraft. A way to solve your problem is simply to blacklist them as logs. This way they won't be interpreted as logs anymore and therefore won't automatically included in the adjacent blocks.
You'd get a conf like:
"blacklistedLogs":["minecraft:stripped_dark_oak_log", "minecraft:stripped_oak_log", "minecraft:stripped_acacia_log", "minecraft:stripped_birch_log", "minecraft:stripped_jungle_log", "minecraft:stripped_spruce_log"],
"whitelistedAdjacentBlocks": ["minecraft:vine", "minecraft:cocoa", "minecraft:dirt", "minecraft:grass"],
Now some details about some points you said:
About the list itself, adding "minecraft:air"
isn't needed as it is added by default.
Basically the adjacent blocks are : air + leaves + logs + whitelisted logs + whitelisted leaves + whitelisted non decay leaves - blacklisted logs - blacklisted leaves
(applied in order).
What I'd expect this to do is to only allow the log blocks that are naturally generated as part of trees
I have no way of telling what is natural and what is not. That's why the black/white lists exists.
Another would be to add a "strict mode", where if it's enabled the mod only allows adjacent blocks that can be naturally generated as part of trees.
That's hard to do. For vanilla it is fine, but when other mods start to come in I can't guess in advance what is a tree. I'd have to rely on the other mod author to properly tag its blocks which is maybe not always the case.
So one idea would be an option for the adjacent blocks whitelist to completely override the default whitelist,
That could be done and is probably the best way to do it IMO, but as I said at the beginning, this doesn't make sense to me. What is considered a tree will be adjacent to a tree.
Setting the blacklist config as you said did solve my issue, thank you!
I have no way of telling what is natural and what is not. That's why the black/white lists exists.
My apologies, I expressed myself poorly there. What I meant is that when a tree grows, the only kind of log that is generated (unless I'm very much mistaken) is the regular one, not the stripped or the wood variants. So a stripped or wood block next to it could be safely assumed to not be part of a naturally generated tree.
About the list itself, adding "minecraft:air" isn't needed as it is added by default.
Yep, I assumed the whitelist would completely override the default, which is why I set it up the way I did.
But as far as my issue goes, the blacklist does the trick! No idea how I skipped over it.
If I had to properly define what my suggestion would be now, it would be to define stripped, wood and stripped wood variants as "not logs" by default, as can be done with the blacklist, since they're not part of a generated tree. But in any case, it's great that the log blacklist gives that option as well!
Cheers!