Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stonecutter recipes are displayed incorrectly #9499

Closed
Wupin opened this issue Jul 16, 2023 · 2 comments
Closed

Stonecutter recipes are displayed incorrectly #9499

Wupin opened this issue Jul 16, 2023 · 2 comments
Labels
resolution: won't fix Issue will not be resolved or feature not added. type: bug Something doesn't work as it was intended to.

Comments

@Wupin
Copy link

Wupin commented Jul 16, 2023

Expected behavior

Recipes in stonecutter should show the result of the recipe

Observed/Actual behavior

Recipes in stonecutter are incorrectly displayed , examples in pictures
image
image

Steps/models to reproduce

Register more than 2 recipes, the method im using to register recipes:

for (int i = 1; i < 10; i++) {
  NamespacedKey key = new NamespacedKey(this, "crsc_" + i);  
  StonecuttingRecipe recipe = new StonecuttingRecipe(key, makeItem(i), Material.OAK_PLANKS);  
  Bukkit.addRecipe(recipe);  
}

Plugin and Datapack List

plugins
[02:29:45 INFO]: Server Plugins (1):
[02:29:45 INFO]: Bukkit Plugins:
[02:29:45 INFO]: - wShop
datapack list
[02:29:48 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[02:29:48 INFO]: There are no more data packs available

Paper version

This server is running Paper version git-Paper-82 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: b533905)
You are running the latest version
Previous version: git-Paper-22 (MC: 1.20.1)

Other

No response

@Wupin Wupin added status: needs triage type: bug Something doesn't work as it was intended to. labels Jul 16, 2023
@Machine-Maker
Copy link
Member

Machine-Maker commented Jul 16, 2023

As far as I know, this is 100% unfixable by Paper. This is an issue with how recipes are handled between the server and the client, and would require a client fix as well. It isn't even a "vanilla issue" because there is no way to add recipes that would cause such an issue in vanilla.


The issue stems from how the clicked button is communicated to the server to select which recipe. Let's start at the beginning:

  1. When a client joins the server, the complete list of recipes is sent to the client in some order.
  2. That list of recipes is then added to the RecipeManager on the client. The client uses collections that do not preserve order to store these recipes, so already we know that recipes are not ordered the same way on the client as the server. This is never an issue however, as nothing relies on the order of recipes
  3. The Stonecutter DOES rely on the order of recipes to know what index to send to the server to know what recipe was selected. The client solves this by sorting the recipe list when it is requested by the stonecutter screen. But this sorting algorithm is only based on the translation key for the result itemstack. This means that any custom nbt is not included in the sorting algorithm.
  4. This causes recipes which have identical output itemstack translation keys to have an undefined order which may differ from the order of the recipes the StonecutterMenu requests to know what index maps to what recipe.
  5. This is not an issue in vanilla, and I'm guessing a bug report opened about it would be closed as invalid because there is no way to specify custom NBT on the result item when creating recipes via the datapack system. All you can specify is the resource location of the item type, and those will all have unique translation keys for the sorting algorithm.

@Wupin Wupin closed this as completed Jul 16, 2023
@Machine-Maker Machine-Maker added the resolution: won't fix Issue will not be resolved or feature not added. label Jul 16, 2023
@Machine-Maker
Copy link
Member

As of 24w10a, this is now probably a vanilla issue and I have opened a bug report accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: won't fix Issue will not be resolved or feature not added. type: bug Something doesn't work as it was intended to.
Projects
Status: Invalid
Development

No branches or pull requests

2 participants