HT's TreeChop

HT's TreeChop

3M Downloads

Dynamic Trees Compatibility

hammertater opened this issue ยท 12 comments

commented

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.

commented

Any change for this compatibility work? Would be the best tree mods running, would be amazing

commented

It actually might be pretty possible now. I'll look into it

commented

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...

commented

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.

commented

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

commented

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:

public static final String KEY_CHOPS = "Chops";
public static final String KEY_SHAPE = "Shape";
public static final String KEY_DROPS = "Drops";
public static final String KEY_ORIGINAL_STATE = "OriginalState";
public static final String KEY_UNCHOPPED_RADIUS = "UnchoppedRadius";
public static final String KEY_MAX_NUM_CHOPS = "MaxNumChops";
public static final String KEY_SUPPORT_FACTOR = "SupportFactor";

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 ๐ŸŽ‰

commented

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:

public static final String KEY_CHOPS = "Chops";
public static final String KEY_SHAPE = "Shape";
public static final String KEY_DROPS = "Drops";
public static final String KEY_ORIGINAL_STATE = "OriginalState";
public static final String KEY_UNCHOPPED_RADIUS = "UnchoppedRadius";
public static final String KEY_MAX_NUM_CHOPS = "MaxNumChops";
public static final String KEY_SUPPORT_FACTOR = "SupportFactor";

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 :)

commented

Ok so on this, there's good and bad news
image
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

commented

Ok so i found the start of the wood ids> 130, but the issue is that i'm unable to change their facing direction
image

commented

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

commented

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

Thank you, i appreciatte your efforts :)

commented

its October, did you guys ever wind up adding compat? or no dice? i feel like everyone likes both mods, maybe HT and you can collab on a compat addon?