Fusion (Connected Textures)

Fusion (Connected Textures)

11M Downloads

[Bug] BlockState passed to ConnectingBakedModel#getModelData() is ignored and instead retrieved from the level again

XFactHD opened this issue ยท 0 comments

commented

Version Info

  • Minecraft: 1.20.1
  • Forge: 47.1.3
  • Fusion: 1.1.0c
  • FramedBlocks: 9.3.0

Are you using OptiFine: No

Description of the Bug
When I initially looked into connection issues of Connected Glass and Rechiseled blocks as camos on FramedBlocks blocks in SuperMartijn642/ConnectedGlass#46, I missed a small detail related to connections between two double blocks. My model calls getModelData() on the Fusion model and passes in its state (which for double blocks happens twice and passes in the respective component state instead of the double block's actual state). Fusion then drops this state when it calls SurroundingBlockData.create() and freshly retrieves all 27 blocks from the level here. Since the edge being checked in the case that is broken in the screenshot below covers both halves of the double block, I need to fall back to deducing the target part from the occlusion behaviour between the local state and the query state if the local state is a double block (which is expected to be the case for "backwards" appearance retrievals where the state of the block being rendered is passed in as the query state). When both the local state and the query state are double blocks because both were freshly retrieved from the world, then this fallback fails as well. The fix is to pass the "self" state which is given as a parameter in ConnectingBakedModel#getModelData() through to SurroundingBlockData.create() and placing it into the states array directly instead of retrieving it from the level again.

Steps to Reproduce

  • Place two Framed Double Panels on top of each other (Framed Double Panels are assembled in-world from two Framed Panels the same way double slabs are made in vanilla)
  • Apply a Fusion-enabled block to one half of each Framed Double Panel
  • Observe connected textures not working at all

Screenshots
2024-08-01_20 00 45