Chipped

Chipped

67M Downloads

[Bug]: Selected item isn't checked when crafting, causing duplication

JoshieGemFinder opened this issue ยท 0 comments

commented

Bug Description

The workbench menu does not check whether the selected item has changed when the player attempts to craft.

This means that if item in the selected slot changes between selecting a recipe and crafting, the items in the selected slot will be converted with the same count.

Because player inventory changes are not guaranteed to notify the currently open menu, the only way around this is to check the item has not changed.

How to Reproduce?

This is a very general bug, but I'll give an example of converting 64 Cobblestone to 64 Diamond Blocks in the Alchemy Table

  1. Hold 1 Diamond Block in your main hand
  2. Open the Alchemy Table's Workbench GUI
  3. Click the Diamond Block in your main hand (so you can see all of the options you could craft it into)
  4. Replace the 1 Diamond Block with 64 Cobblestone
    • Note: using item replace in a command block is the easiest way to replace these items in singleplayer (where there is no ping); however, with enough lag or with extra client mods to send player action packets (which are vanilla packets that change the inventory while bypassing the currently open screen), this is doable even on a dedicated server running no mods other than Chipped
  5. Note that the item has changed in the selected slot without updating the recipes in the GUI
  6. Press craft, turning the 64 cobblestone in the selected slot into 64 diamond blocks

Expected Behavior

When the player presses craft, the recipe will fail as the original selected items have changed item (using the example: as the diamond blocks originally selected are now cobblestone)

Version

3.0.7, 3.1.5, 4.0.2

Mod Loader Version

Fabric 0.17.2; NeoForge 1.20.4 - 20.4.250, 1.21.1 - 21.1.201; Forge 1.20.1 - 47.4.6, 1.20.4 - 49.2.0, 1.21.1 - 52.1.3

Mod Loader

Fabric, NeoForge, Forge, Quilt

Logs or additional context

No response

Code of Conduct

  • I have searched the issue tracker and confirmed that the issue has not been reported
  • I have checked the FAQ (if one is present) and my issue is not listed
  • I have verified that I am using the latest version of the mod
  • I have verified that I have installed all the required dependencies for the mod
  • I have verified that I do not have Optifine installed. We will close issues if we detect Optifine is in your pack. We cannot fix Optifine issues. Please do not report issues with Optifine present.