Structurize

Structurize

40M Downloads

Chests are placed empty

uecasm opened this issue ยท 13 comments

commented

Prerequisites

  • I am running the latest alpha version of 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.16.5
  • Structurize Version: 0.13.175
  • MineColonies Version (if related bug): 0.14.197
  • Related Mods and their Versions:

Expected behavior

Building or pasting a schematic should include items in chests.

Actual behavior

The chests appear but they are always empty. The blueprint file itself does contain the item data, so it's the build that's failing rather than the scan.

Steps to reproduce the issue

  1. Try to build the asiansupplycamp, either with a normal supply camp item or with either of the build tool paste buttons.
  2. Note that all the chests are empty, but there are items in the racks and barrels. (But there is supposed to be a build tool and TH block in one of the chests, which you can see in the blueprint data and on the schematic server.)
  3. Also try building this schematic: chest-test.zip; it should contain 64 redstone blocks.

Logs

There is nothing relevant in logs. This was reproduced in a dev environment with no other mods.

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

Yes, that's what I meant by "only on client side". So it'd need something very similar but on server side instead.

Having said that, I don't really see the reason why it's calling getItemStacksOfTileEntity at all -- it just throws the result away. Presumably the subsequent call to set the entity NBT data would actually do the correct thing if the exception weren't making it return early.

commented

Yeah, it works fine for racks, because they just return the single rack inv if the world is null.

commented

The only thing we can really do is a have special chest handler that queries just the single chest inventory, if necessary with an AT.
The only way to avoid issues with double chests too.

commented

We should probably make a special handler for chests. This is because we're trying to use the itemHandler capability to obtain the inventory items. But, that one requires to query the world for chests which isn't possible. So that's why it fails.

commented

ye chests are stupid and need a world for their inventory, so they atm just won't get the inventory placed

commented

There is already a special handler for chests, that's where it's getting a NullReferenceException inside TileEntity.

It looks like after the call to readTileEntity in getItemStacksOfTileEntity it just needs to call setWorldAndPos on the resulting entity, and that should fix that at least...

commented

No, that's what it used to do, this will query the neighboring chest from the world and cause a lot of bugs.

commented

Can't it pass in the BlueprintAccess world instead?

commented

no its World type

commented

BlueprintBlockAccess is a World. Although it also looks like it's only on client side at present, which might be an issue.

commented

oh you're right was thinking its just a IBlockaccess

commented

BlueprintBlockAccess only exists during rendering afaik. Not during building.

commented

problem would still be there though. We don't want to query a double chest inventory twice.