Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

Mirrored ghost recipes in crafting GUI

Open ofunny opened this issue 10 months ago • 8 comments

Describe the bug

In Bedrock recipes with a given layout will also show the craftable item if you mirrow/flip the recipe. The mirrored recipe however will not work of course, so players get confused and believe that the recipe does not work at all.

To Reproduce

  1. Just use a recipe what can be flipped/mirrored
  2. Add items to a crafting GUI (like crafting table) in a flipped/mirrored way
  3. The item will appear as a craftable item within the result slot but can not be crafted

Expected behaviour

Same behavior as in Java, no flipped/mirrored recipes what show a craftable item that does not really exist for the flipped/mirrored recipe.

Screenshots / Videos

For example a recipe for a light saber mirrored horizontally:

Java normal image

Java mirrored image

Bedrock normal image

Bedrock mirrored image

Video https://resource.ofunny.world/dev/issuereports/mirrowed_recipe.mp4

Server Version and Plugins

No response

Geyser Dump

https://dump.geysermc.org/GWrwFwEHx2y719MI2XdiNrqdBSOe1tS0

Geyser Version

Geyser Version 2.2.0-SNAPSHOT (git-master-bf81fc1) (Java: 1.20, Bedrock: 1.20.0 - 1.20.10)

Minecraft: Bedrock Edition Device/Version

1.20.15

Additional Context

No response

ofunny avatar Sep 06 '23 19:09 ofunny

How are you creating the recipes? Could you send some examples?

onebeastchris avatar Sep 06 '23 20:09 onebeastchris

In this case I use Itemsadder what adds the recipes, so I can not provide a code example. What we could test, would be other plugins and if it happens a well with them. Also, I could raise an issue on the Itemsadder Git page referencing the current one, so that any specific implementation question could be answered by Lonedev (if he would be so kind).

I also wanted to test it with vanilla recipes, but I have no vanilla recipes in my mind what are using a strict pattern like this. More over, most vanilla recipes (even though they usually have a specific suggested pattern and a specific crafting slot order) can be placed in any slot and multiple directions as long as the resample the vanilla recipe in any way.

It looks like Geyser/Bedrock behaves the same way with custom recipes. No matter what slot or order they are being placed in, they will still show the final result as craftable as long as the kind of resample the original recipe (like many vanilla items), of course, the Java server will than deny the crafting if the crafting pattern in the crafting table does not strictly follow the slot and item order defined by the custom recipe.

You can also see the correct item name for the craftable item when the recipe is a mirrowed/uncraftable one, but the name defined in the custom item mappings file (hash for example, if Kasltes converter was used) for the actual pattern that will finally work. Maybe that all is now a bit confusing, I can make a video so it's better understandable.

ofunny avatar Sep 06 '23 21:09 ofunny

Recorded it https://resource.ofunny.world/dev/issuereports/mirrowed_recipe.mp4

ofunny avatar Sep 06 '23 22:09 ofunny

https://wiki.bedrock.dev/loot/recipes.html#symmetry Looks like this is also done by the Bedrock client, although there might be a way to block the recipe? I only know that Geyser can manually re-test for a missing recipe from the recipe book and show it as an output, maybe it's possible to do the opposite too

onebeastchris avatar Sep 06 '23 23:09 onebeastchris

Yeah, looks like it. I just tested it on Bedrock again, before you combine the pattern in the crafting table, as defined by Java, within the current Bedrock session the first time, no other combination will work except of a direct mirrored pattern to the other side (not sure why the mirrored still works).

After the result has been shown at least once with the same client for the given session, all other combinations like moving one row up or one row down will show the resulting item. So it looks like the client is caching the result and than handles it internally.

ofunny avatar Sep 06 '23 23:09 ofunny

https://wiki.bedrock.dev/loot/recipes.html#symmetry Looks like this is also done by the Bedrock client, although there might be a way to block the recipe? I only know that Geyser can manually re-test for a missing recipe from the recipe book and show it as an output, maybe it's possible to do the opposite too

I've just checked out https://wiki.bedrock.dev/loot/recipes.html#symmetry If you scroll up a bit

To restrict placements to a particular location, use explicit spaces, 
which enforce empty slots in certain locations.
The following is only usable in the upper-left corner of a grid:

"pattern": [
	"O  "
	"OO "
	"   "
]

Wouldn't that eliminate most problems mentioned in the report video, except of direct horizontally symmetric usage, what than can be easily caught by any Java plugin, by just allowing one more horizontally mirrored recipe?

ofunny avatar Sep 07 '23 00:09 ofunny

If possible could you please test https://github.com/GeyserMC/Geyser/pull/4561 on a 1.20.80 preview client and see if that resolves the issue? You can obtain the preview client for a specific version using the unofficial BedrockLauncher.

Kas-tle avatar Apr 22 '24 14:04 Kas-tle

If possible could you please test #4561 on a 1.20.80 preview client and see if that resolves the issue? You can obtain the preview client for a specific version using the unofficial BedrockLauncher.

Sure thing, I will perform the tests this afternoon and update you afterwards.

ofunny avatar Apr 22 '24 15:04 ofunny