Malum

Malum

2M Downloads

[BUG][1.18.2] Runewood/Soulwood leaves' distance block property is always 1 when grown

thetos7 opened this issue · 5 comments

commented

Malum version: 1.3.7

What happened

When malum trees grow naturally or with bonemeal, the distance property of leaves is always set to 1, however, it should be set to the distance (26-neighbourhood distance1) to the nearest log, like vanilla trees do. This happens correctly when growing the trees with the Create mod's tree fertilizer.

Examples

Incorrect distances (grown with bonemeal)

2022-08-12_14 55 41

2022-08-12_14 55 43
The distance value should be 2.

Correct distances (grown with the Create mod's tree fertilizer)

2022-08-12_14 55 49

2022-08-12_14 55 51

Oak tree for comparison

2022-08-12_15 08 19
2022-08-12_15 08 23

Steps to reproduce

  • place runewood sapling or soulwood sapling
  • grow the sapling (wait or bonemeal)
  • inspect leaves' block properties with F3 (right side)

Footnotes

  1. schema of 26-neighbourhood on page 3: https://arxiv.org/pdf/1803.04190.pdf

commented

The distance values (for runewood trees) seem to be initially set to 1 here:

filler.entries.add(new BlockStateEntry(BlockRegistry.RUNEWOOD_LEAVES.get().defaultBlockState().setValue(LeavesBlock.DISTANCE, 1).setValue(MalumLeavesBlock.COLOR, leavesColor), leavesPos));

commented

Yeah hmm, I kind of put this problem aside when developing the feature at first. I don't think it's too big of a deal.
If I don't set it to 1, I believe some of the leaves would start to decay instantly, which made the trees look bad. I'm not sure what the best solution here is.

commented

It's minor I guess, during normal gameplay with malum only, it doesn't affect much, leaves decay normally and stuff. However I think this breaks the behavior of Create's saws, for example, which do not break all the leaves currently (they should).

So it may only create minor incompatibilities.

commented

image
I don't even understand why this happens but like, if I don't force the leaves into a distance of 1 they just get thanos snapped after the game ticks a bit.

commented

I made all the leaves tick the moment they're placed as a test, it definitely works but it might not be the best solution.