Blueprint

Blueprint

57M Downloads

Leaf placement in TreeUtil does not properly set initial state.

SeanDougherty opened this issue ยท 1 comments

commented

https://github.com/team-abnormals/blueprint/blob/1.18.x/src/main/java/com/teamabnormals/blueprint/core/util/TreeUtil.java

When placing leaf blocks, the common practice amongst all Abnormals repos is to call TreeUtils.setForcedState().

This places the block at the given position with the 18 flag, which prevents neighbor reactions (e.g., fences connecting) [16] and sends the change to the client [2]. However, leaf placement also requires a block update upon placement in order to properly manage the leaf block's distance property, so the flag should be incremented to 19 which enables the [1] flag that causes a block update.

What will this fix accomplish?
Trees in Abnormal mods will now generate in a valid initial state. Allowing for improved compatibility. Without this fix, mods that use DFS traversals will fail when interacting with Abnormal leaf blocks (e.g., Create Mod's sawcutter). This is because (currently) all Abnormal leaf blocks generate with a distance of 1.

setForcedState Flags:
image

commented

Side note:
As Environmentals does not currently utilize Abnormals Blueprint lib, I have raised a similar issue on that repo and included a tiny PR that fixes this issue in Environmentals.

team-abnormals/environmental#279