Pane In The Glass

Pane In The Glass

7M Downloads

Building Gadgets + Pane In The Glass = Problems

NielsPilgaard opened this issue ยท 8 comments

commented

Building Gadgets version

  • buildinggadgets-1.16.5-3.8.0

Forge version

  • Forge-1.16.5-36.0.46

Do you have optifine installed?

  • No

Modpack (with version), if applicable

  • Enigmatica 6 v0.4.3 in-dev

How to reproduce the issue

  • Attempt to place Glass pane (edge aligned) from the mod Pane in the Glass with a Building Gadget
  • Observe the bug

A screenshot, if applicable
Screenshot of the affected Pane selected in Building Gadget in build-to-me mode.
billede

Normal Glass Panes for comparison
billede

Anything else we should know?
Reported to Building Gadgets here: Direwolf20-MC/BuildingGadgets#622

commented

@MichaelHillcox pretty sure we can simulate a ray-trace by calculating the line between the players eyes and the block to be placed. (I also remember debugging a crash (when playing around with a bunch of modded tiles in 1.14) due to this not being provided - why is this gone again? Maybe I can find and link the code that used to do that. Might also be that it got lost at some point due to the requirement of storing this in the effect block and I think these tests were still without them.)

Note that this would of course result in the glass panes possibly looking different when placing them using the gadgets, than the selected one looked like. So it would likely be better to have all the relevant properties in the blockstate (or some tile data), so that it can just be copied.

commented

Oh, yeah, I knew this was going to bite me some time. I use the player's look target to determine where to place the pane and the building gadget isn't providing the same info.

I think I'm going to change the placement algorithm to default to a side if the mod can't determine the look target instead of the current "no side" behavior. I left the "no side" behavior in so I could easily determine if the look target was not being resolved correctly.

commented

Hi (Maintainer on Building Gadgets here), we can likely provide this information if you can let me know how to provide it ๐Ÿ‘

commented

All the data is stored in blockstate. The block state parameters are NORTH, SOUTH, WEST, EAST, UNBREAKABLE, and WATERLOGGED.
The initial block state is determined in the getStateForPlacement call by using the getHitVec from the passed context.

I'm not doing anything fancy with the block, all the logic for visuals is in the blockstate model (no custom renderer).

I updated the model shape data to provide a full block hit box if the blockstate combination was invalid so you can at least see the phantom block. The pane placed with the Building Gadget has all the blockstate parameters set to false which is not a valid config.

commented

@MichaelHillcox How does the Building Gadget get/set the blockstate properties? It may just be a missing method on my part that is not populating the state when you copy the block.

commented

We process the block state here. I know this recently got changed so it might have messed something up but from my understanding, it should default anything not allowed to their defaults and leave the rest as is. https://github.com/Direwolf20-MC/BuildingGadgets/blob/master/src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/InventoryHelper.java#L267

commented

Oh, that's it! You have NORTH, SOUTH, EAST and WEST marked as UNSAFE_PROPERTIES.
Not sure what the best way forward for this is. Changing the property names on my end will break all existing user's builds.

commented

Hmm, I'm actually not sure why we're resetting the facing. I'll ping the dev that created this part of the code.