GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.76k stars 686 forks source link

Cannot Copy Books #3682

Open TheFloyds4240 opened 1 year ago

TheFloyds4240 commented 1 year ago

Describe the bug

A player sent me this video saying that they cannot copy books using a crafting table.

To Reproduce

  1. Write a book
  2. Get another book
  3. Place them on a crafting table
  4. Try to move the new book to your inventory
  5. Book glitches back to the crafting table

Expected behaviour

The book is expected to move into the player's inventory

Screenshots / Videos

https://user-images.githubusercontent.com/80289503/232594051-121e16d3-7bde-41cc-aa28-9a9034a9400a.mp4

Server Version and Plugins

I don't have console access to the server - It's on PurpurMC 1.19.3

Geyser Dump

https://dump.geysermc.org/7DHpYrH4sqJz972yZqcV1qJJqQbrRLhp

Geyser Version

Latest

Minecraft: Bedrock Edition Device/Version

PE

Additional Context

NA

YHDiamond commented 5 months ago

Did some digging... This issue (which doesn't occur 100% of the time by the way) seems to be caused by the deprecatedCraftAction returning two result items instead of one... Looking at the ItemData it seems the only discrepancy between the two items is the "generation" field in which one version has "1i" and the other has "2i" which seems to be referring to the number of generations to the original source book.

Turn on debug mode and you can see this for yourself, or take a look at the error from when I tried.

java.lang.Throwable: DEBUGGING: ItemStackRequest rejected ItemStackRequest(requestId=-1699, actions=[CraftRecipeAction(recipeNetworkId=5), CraftResultsDeprecatedAction(resultItems=[BaseItemData(definition=SimpleItemDefinition(identifier=minecraft:written_book, runtimeId=524, componentBased=false), damage=0, count=1, tag={
  "GeyserHash": -754300022i,
  "author": "YHDiamond",
  "generation": 2i,
  "pages": [
    {
      "photoname": "",
      "text": "test"
    }
  ],
  "title": "TEST"
}, canPlace=[], canBreak=[], blockingTicks=0, blockDefinition=GeyserBedrockBlock{minecraft:cyan_terracotta}, usingNetId=false, netId=0), BaseItemData(definition=SimpleItemDefinition(identifier=minecraft:written_book, runtimeId=524, componentBased=false), damage=0, count=1, tag={
  "GeyserHash": -754300022i,
  "author": "YHDiamond",
  "generation": 1i,
  "pages": [
    {
      "photoname": "",
      "text": "test"
    }
  ],
  "title": "TEST"
}, canPlace=[], canBreak=[], blockingTicks=0, blockDefinition=GeyserBedrockBlock{minecraft:cyan_terracotta}, usingNetId=false, netId=0)], timesCrafted=1), ConsumeAction(count=1, source=ItemStackRequestSlotData(container=CRAFTING_INPUT, slot=36, stackNetworkId=221)), ConsumeAction(count=1, source=ItemStackRequestSlotData(container=CRAFTING_INPUT, slot=40, stackNetworkId=218)), CreateAction(slot=0), TakeAction(count=1, source=ItemStackRequestSlotData(container=CREATED_OUTPUT, slot=50, stackNetworkId=-1699), destination=ItemStackRequestSlotData(container=CURSOR, slot=0, stackNetworkId=0)), CreateAction(slot=1), PlaceAction(count=1, source=ItemStackRequestSlotData(container=CREATED_OUTPUT, slot=50, stackNetworkId=-1699), destination=ItemStackRequestSlotData(container=HOTBAR_AND_INVENTORY, slot=31, stackNetworkId=157))], filterStrings=[], textProcessingEventOrigin=null)
    at org.geysermc.geyser.translator.inventory.InventoryTranslator.rejectRequest(InventoryTranslator.java:811)
    at org.geysermc.geyser.translator.inventory.InventoryTranslator.rejectRequest(InventoryTranslator.java:800)
    at org.geysermc.geyser.translator.inventory.InventoryTranslator.translateCraftingRequest(InventoryTranslator.java:473)
    at org.geysermc.geyser.translator.inventory.InventoryTranslator.translateRequests(InventoryTranslator.java:170)
    at org.geysermc.geyser.translator.protocol.bedrock.BedrockItemStackRequestTranslator.translate(BedrockItemStackRequestTranslator.java:48)
    at org.geysermc.geyser.translator.protocol.bedrock.BedrockItemStackRequestTranslator.translate(BedrockItemStackRequestTranslator.java:38)
    at org.geysermc.geyser.registry.PacketTranslatorRegistry.translate0(PacketTranslatorRegistry.java:89)
    at org.geysermc.geyser.registry.PacketTranslatorRegistry.lambda$translate$0(PacketTranslatorRegistry.java:69)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
    at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)