3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00

Fix shift clicking Stonecutter output (#3854)

Dieser Commit ist enthalten in:
AJ Ferguson 2023-06-09 21:23:10 -04:00 committet von GitHub
Ursprung 1788295291
Commit 1d99f8beb8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -62,19 +62,20 @@ public class StonecutterInventoryTranslator extends AbstractBlockInventoryTransl
}
StonecutterContainer container = (StonecutterContainer) inventory;
ItemStack javaOutput = craftingData.output();
int button = craftingData.buttonId();
// If we've already pressed the button with this item, no need to press it again!
if (container.getStonecutterButton() != button) {
ItemStack javaOutput = craftingData.output();
// Getting the index of the item in the Java stonecutter list
ServerboundContainerButtonClickPacket packet = new ServerboundContainerButtonClickPacket(inventory.getJavaId(), button);
session.sendDownstreamPacket(packet);
container.setStonecutterButton(button);
if (inventory.getItem(1).getJavaId() != javaOutput.getId()) {
// We don't know there is an output here, so we tell ourselves that there is
inventory.setItem(1, GeyserItemStack.from(javaOutput), session);
}
}
if (inventory.getItem(1).getJavaId() != javaOutput.getId()) {
// We don't know there is an output here, so we tell ourselves that there is
inventory.setItem(1, GeyserItemStack.from(javaOutput), session);
}
return translateRequest(session, inventory, request);