stfwi / engineers-decor

Engineer's Decor
MIT License
35 stars 16 forks source link

Small tree cutter only cutting the bottom log from the "myrtrees" rubberwood trees #228

Closed shrad1994 closed 1 year ago

shrad1994 commented 1 year ago

https://github.com/AllTheMods/ATM-8/issues/485

More screenshots located here - I'm thinking it may actually have something to do with their tags rather than with your cutter but I really don't know anything about the code so I figured I'd let you know.

stfwi commented 1 year ago

Hi, this may be a generic compat problem. The Tree Cutter chopping is uses a contour finding with logs and corresponding leaves to allow also chopping "trees of unknown structure". It searches for the same wood for that, means different blockstates, but same block. If the rubber stem is a different block, then the cutter is not allowed to chop it, because it could be a manually placed block.

https://github.com/stfwi/engineers-decor/blob/837b8678f4fb5ebd818d14c5cbb476273be8405b/src/main/java/wile/engineersdecor/detail/TreeCutting.java#L41-L53

The only idea crossing my mind to resolve this is to introduce a generic tag that makes isSameLog() always returning true if the compared block is a .LOGS or has that marker tag itself. From Jakes repo, RubberWoodLog and FilledRubberWoodLog are different blocks, and I presume if he would to change that, a lot of existing game setups would probably break. It may be the most sensible way to adapt the chopper.

stfwi commented 1 year ago

Alright, after "sleeping a night over it" let's go for a config instead of a tag. Tags can't be referenced optionally. So, in the ED server config I added the tree_cutter_universal_logs list setting for these things. As a default the rubber block is already added (should show in the log file output).

Could you take a look with your setup if that does the trick? I only tested by adding minecraft:stone in the dev IDE, but am a bit too short on time to install ATM for a release test.

2022-12-23-dist.zip

If it's ok, I gonna push a release to curse/modrinth. Cheers,-

shrad1994 commented 1 year ago

I will give it a go here in a moment and let you know.

shrad1994 commented 1 year ago

Sorry to keep you waiting, it absolutely does work now; at least with the rubberwood trees. Thank you for the rapid fix!

stfwi commented 1 year ago

No worries man, ty for doing the release testing!