-
Bug
-
Resolution: Fixed
-
24w10a, 24w12a
-
None
-
Confirmed
-
Crafting, UI
-
Important
-
Platform
This issue has existed for a while, but until 24w10a it didn't apply to vanilla as there was no way to add recipes to a stonecutter for which the result itemstack had any custom data. With data components and the codecs for recipes being updated to allow custom data, this issue is now reproducible in vanilla.
You cannot add 2 recipes with a common input whose outputs are the same item type. I have attached a datapack that reproduces the problem, adding 16 recipes, one for each light block level when given an oak plank as an input. You can see that by clicking on the buttons for each recipe, the output does not match the button you clicked.
The cause is a little complex and I first explained it here. The gist is that the Stonecutter recipe selection system relies on a list index for all applicable recipes being the same on the client and server. But the *ordering* of that list is set by RecipeManager#getRecipesFor(RecipeType, Container, Level). In getRecipesFor, the list is sorted using a Comparator that compares the description IDs for the result item which leads to ambiguous ordering when 2 identical result items are present. So the indices in this list get out of sync between the client and the server leading to the visual inconsistency between the button icons and the itemstack put into the result slot of the stonecutter inventory.
Steps to Reproduce
- Download and install the attached test_datapack.
- Place an oak_plank inside a Stonecutter and click around on the various recipes that show up, recipes that are added by the datapack
- Observe that the item created in the result slot does not match the recipe that you clicked on.
- is duplicated by
-
MC-269823 Stonecutter Items Incorrect with Custom Components
- Resolved