Engineer's Decor

Engineer's Decor

19M Downloads

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

shrad1994 opened this issue ยท 5 comments

commented

AllTheMods/ATM-8#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.

commented

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.

private static boolean isLog(BlockState state)
{ return (state.is(BlockTags.LOGS)); }
private static boolean isSameLog(BlockState a, BlockState b)
{ return (a.getBlock()==b.getBlock()); }
private static boolean isLeaves(BlockState state)
{
if(state.getBlock() instanceof LeavesBlock) return true;
if(state.is(BlockTags.LEAVES)) return true;
return false;
}

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.

commented

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

commented

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

commented

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

commented

No worries man, ty for doing the release testing!