Dynamic Trees Compatibility
hammertater opened this issue ยท 12 comments
See https://www.curseforge.com/minecraft/mc-mods/dynamictrees. It would be great to have a more seamless chopping experience between vanilla-style trees and dynamic trees.
Any change for this compatibility work? Would be the best tree mods running, would be amazing
Any progress on this btw? Seems like it's been quite dead in this issue report for over an year. would like to know if i'm allowed to fork so i can add compatbility myself between the two...
Hey @MetalKnight56, no progress yet. I actually think it would make the most sense to either create a separate "treechop-dynamic trees compat" mod, or update/fork Dynamic Trees rather than TreeChop. Because DT's trees are completely different from vanilla-style trees, there's really not much opportunity to resuse TreeChop code, other than visual stuff like activating the chop indicator. The core of the compatibility - making DT blocks choppable - means changing the way their blocks behave and render, which would require pretty invasive edits to their code, as none of that can be done with their API to my knowledge. And without full API support from DT, any solutions from TreeChop's end would probably be pretty unstable whenever DT gets updated.
I've been considering making a separate compat mod once I get TreeChop updated to 1.20.2/etc., but yeah, you're welcome to fork TreeChop if you'd like.
hop code, other than visual stuff like
Oh i see, btw, wanted to know then if you could perhaps then add a config option to make tree stumps harder to break or straight up unbrekable without a certain tool tier or tool... Have been trying to create a datapack that when you break a tree log it spawns a cut log from treechop but i can't seem to get different layer levels on it through nbt nor can i change the log type when using /setblock ... Thanks in advance
make tree stumps harder to break
I've never planned on doing anything with stumps, but other mods that do that (like https://www.curseforge.com/minecraft/mc-mods/stumps, but it needs updating) should be work fine with TreeChop
i can't seem to get different layer levels on it through nbt
The data that treechop saves for chopped blocks is stored under these keys:
treechop/shared/src/main/java/ht/treechop/common/block/ChoppedLogBlock.java
Lines 278 to 284 in 29d03d5
Incrementing the value of Chops
should work, but you'd also need to find a way to tell the game the block changed to affect it immediately, otherwise nbt changes only show up when reloading the chunk or world. I'm not very familiar with data packs or minecraft's console commands, it might be possible, I dunno.
nor can i change the log type when using /setblock
Yeah, most of the info in chopped log blocks is stored in the block entity, so you can only really change things through nbt changes or in Java
Edit: I'll look into using /data commands (https://minecraft.fandom.com/wiki/Commands/data) to change the properties of chopped blocks, like you mentioned. If it isn't working, I'll update treechop to make this possible ๐
make tree stumps harder to break
I've never planned on doing anything with stumps, but other mods that do that (like curseforge.com/minecraft/mc-mods/stumps, but it needs updating) should be work fine with TreeChop
i can't seem to get different layer levels on it through nbt
The data that treechop saves for chopped blocks is stored under these keys:
treechop/shared/src/main/java/ht/treechop/common/block/ChoppedLogBlock.java
Lines 278 to 284 in 29d03d5
Incrementing the value of
Chops
should work, but you'd also need to find a way to tell the game the block changed to affect it immediately, otherwise nbt changes only show up when reloading the chunk or world. I'm not very familiar with data packs or minecraft's console commands, it might be possible, I dunno.nor can i change the log type when using /setblock
Yeah, most of the info in chopped log blocks is stored in the block entity, so you can only really change things through nbt changes or in Java
Edit: I'll look into using /data commands (minecraft.fandom.com/wiki/Commands/data) to change the properties of chopped blocks, like you mentioned. If it isn't working, I'll update treechop to make this possible ๐
Thank you, appreciatte the efforts :)
Ok so on this, there's good and bad news
So i am indeed able to set different chop states with commands and also change which block is chopped, but the thing is, i'm unsure what are the number IDs for each log. I thought i would be able either use the old 1.13 ids or just staright up add the block's registry name, but that doesn't seem to be the case
Here's the command i used to do the things showed in the screenshot:
/setblock ~ ~ ~ treechop:chopped_log{Chops:x, OriginalState:xxx}
Just change the values o X to your desired number
Chops ranges from 0 - 7 and the OriginalState i haven't been able to map each id yet
Nice stuff! The block's facing is determined by the OriginalState
block state. For oak_logs, if 130 is on the X axis, then 131 the Y axis, 132 the Z axis, I think
Also, treechop 0.18.7 (just posted on curseforge, only for 1.20.1 at the moment) should fix any visual issues caused by /data commands, if you want to modify chopped blocks in-place
Nice stuff! The block's facing is determined by the
OriginalState
block state. For oak_logs, if 130 is on the X axis, then 131 the Y axis, 132 the Z axis, I thinkAlso, treechop 0.18.7 (just posted on curseforge, only for 1.20.1 at the moment) should fix any visual issues caused by /data commands, if you want to modify chopped blocks in-place
Thank you, i appreciatte your efforts :)