LittleTiles icon indicating copy to clipboard operation
LittleTiles copied to clipboard

Ensures All doors in blueprint are saved as closed

Open Doc-1 opened this issue 1 year ago • 3 comments

This is to fix a certain issue when saving an already opened door into a blueprint. It does not reset the NBT tag "opened" to false. It remaining true prevents it from opening properly.

Doc-1 avatar Apr 03 '24 00:04 Doc-1

There is a method in LittleStructureType called finalizePreview, rather do it there. I think you basically do the same thing in LittleDoorBaseType. Not sure if this is an issue in 1.20. Furthermore I still do not understand 100% why this actually causes any issues. Have not found the time yet to look into it.

CreativeMD avatar Apr 16 '24 11:04 CreativeMD

This causes an issue with auto-opening doors. When you save an already opened, auto-opening door, and place it in the world. The door does not update it's signaling to auto-open the door. How to reproduce:

  1. Create a door with a signaling of 1=b0.
  2. Place the door down.
  3. Place a tile and save the door plus tile.
  4. Place the new save down. The door will remain closed.

This is where the door's state not being reset to 0 causes the issue. https://github.com/CreativeMD/LittleTiles/blob/286a79735bd512629467898d3b67a723a7c0def5/src/main/java/com/creativemd/littletiles/common/structure/type/door/LittleDoor.java#L175

Doc-1 avatar Apr 16 '24 12:04 Doc-1

But your fix would mean that the door state will get switched, in case you pick up the structure in the opened state and save it in the blueprint again.

CreativeMD avatar Apr 16 '24 17:04 CreativeMD