ldtteam / Structurize

Minecraft Structures
GNU General Public License v3.0
44 stars 45 forks source link

[BUG] Builder does not consume the correct amount of items #674

Open natrow opened 2 months ago

natrow commented 2 months ago

Is there an existing issue for this?

Are you using the latest MineColonies Version?

Did you check on the Wiki? or ask on Discord?

What were you playing at the time? Were you able to reproduce it in both settings?

Minecraft Version

1.20.1

MineColonies Version

1.1.586-BETA

Structurize Version

1.0.733-RELEASE

Related Mods and their Versions

  1. Forge Version: 47.1.3 2. JEI Version: 15.2.0.21 3. BlockUI Version: 1.0.139-BETA 4. DO Version: 1.0.184-BETA

Note: I'm developing a custom compatibility mod, available at https://github.com/natrow/tfc_minecolonies/tree/1.20.1

Current Behavior

After registering a custom placement handler that requires an ItemStack with a non-one quantity, only a single item is consumed despite the builder (correctly) requesting all the items and the build screen showing all the required items.

Expected Behavior

All the required items should be consumed, not just a single one from the stack

Reproduction Steps

  1. Create and register a PlacementHandler
  2. Override the getRequiredItems() method to return an item stack with a quantity larger than one
  3. Create a build request that will use the affected PlacementHandler
  4. Observe that despite the builder requiring all of the items, only a single one is consumed

Logs

https://pastebin.com/a3hfXgKM

Anything else?

Raycoms commented 2 months ago

Override the getRequiredItems() method to return an item stack with a quantity larger than one

Unfortunately you have to make this a list of itemstacks of size 1 atm

natrow commented 2 months ago

Would it work if I just made several stacks of the same item instead?

Edit: this does work as a temporary workaround.

Raycoms commented 2 months ago

Yes

Sent from Proton Mail Android

-------- Original Message -------- On 6/4/24 22:17, Nathan Rowan wrote:

Would it work if I just made several stacks of the same item instead?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>