MineColonies

MineColonies

57M Downloads

Custom schematic names cause incorrect building rotation

uecasm opened this issue ยท 2 comments

commented

Prerequisites

  • I am running the latest alpha version of MineColonies and Structurize for my Minecraft version.
  • I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
  • I made sure that this issue is not a duplicate of any existing issue.

Context

  • Minecraft Version: 1.17
  • MineColonies Version: dev 6aa619b

Expected behavior

Buildings have the correct rotation.

Actual behavior

ISchematicProvider.getSchematicName() returns a hard-coded schematic name based on building type, which is usually fine as a default.

However some builders are getting especially creative and using hut blocks with custom schematic names that are different from the defaults. While these mostly work ok, there are still parts of the code that try to call the above and get the "wrong" schematic name.

In this particular case, that is AbstractSchematicProvider.getRotation, which loads the (wrong) schematic to try to compare block orientations, but fails due to using the wrong name (either completely failing if the schematic is "missing" or apparently succeeding but checking the wrong schematic).

There's probably other cases where this happens; rather than patching this one spot there ought to be a comprehensive check for all callers, making sure it uses the custom name where applicable (or that feature needs to be removed again).

Part of the confusion is that IBlueprintDataProvider.getSchematicName() is implemented in AbstractTileEntityColonyBuilding to be a custom schematic name (or empty) -- the two are used fairly interchangeably but are not the same. The former needs to always defer to the latter when it's non-empty.

Steps to reproduce the issue

  1. Get the latest 1.17 Frontier schematics.
  2. Build the frontiermodded warehouse L1.
  3. Try to build something near the courier hut in the back and observe that the L5 preview probably doesn't face the building, as intended -- then try to actually build the building and observe that it built that way too.
  4. For further evidence, now build another copy of the warehouse but in a different rotation, then build the courier and observe that it was built using the same absolute rotation as before, not following the warehouse's orientation or that of the hut block itself.

Logs

Not relevant.

Notes


Viewers

  • Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
  • Add a comment if you have any insights or background information that isn't already part of the conversation.
commented

having this issue with the Steampunk Tavern/Town hall. Pasted in sptavern0 into townhall1 in the correct orientation on the schematic server. after the town hall was built in a single player world and the tavern was ordered to be constructed it ended up being constructed 90 degrees counterclockwise to the correct orientation. please note, there is NO tavern1-3 schematic, ONLY sptavern0-3.

Schematics sent directly to Raycoms via Discord.
Image1: shows how the sptavern0-3 are aligned in the Town Hall building.
https://cdn.discordapp.com/attachments/859143741381541888/973881576356188180/2022-05-11_19.37.08.png

Image2: moved from front right corner to back right corner and you can see how the tavern has rotated after being built
https://cdn.discordapp.com/attachments/859143741381541888/973881821316136980/2022-05-11_19.37.57.jpg

Image3: shows alignments on the schematic server.
https://cdn.discordapp.com/attachments/859143741381541888/973883057000026112/2022-05-11_19.43.16.png

commented

Afaik this was fixed in 1.19