mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix shift clicking Stonecutter output (#3854)
This commit is contained in:
parent
1788295291
commit
1d99f8beb8
1 changed files with 7 additions and 6 deletions
|
@ -62,20 +62,21 @@ public class StonecutterInventoryTranslator extends AbstractBlockInventoryTransl
|
||||||
}
|
}
|
||||||
|
|
||||||
StonecutterContainer container = (StonecutterContainer) inventory;
|
StonecutterContainer container = (StonecutterContainer) inventory;
|
||||||
|
ItemStack javaOutput = craftingData.output();
|
||||||
int button = craftingData.buttonId();
|
int button = craftingData.buttonId();
|
||||||
|
|
||||||
// If we've already pressed the button with this item, no need to press it again!
|
// If we've already pressed the button with this item, no need to press it again!
|
||||||
if (container.getStonecutterButton() != button) {
|
if (container.getStonecutterButton() != button) {
|
||||||
ItemStack javaOutput = craftingData.output();
|
|
||||||
|
|
||||||
// Getting the index of the item in the Java stonecutter list
|
// Getting the index of the item in the Java stonecutter list
|
||||||
ServerboundContainerButtonClickPacket packet = new ServerboundContainerButtonClickPacket(inventory.getJavaId(), button);
|
ServerboundContainerButtonClickPacket packet = new ServerboundContainerButtonClickPacket(inventory.getJavaId(), button);
|
||||||
session.sendDownstreamPacket(packet);
|
session.sendDownstreamPacket(packet);
|
||||||
container.setStonecutterButton(button);
|
container.setStonecutterButton(button);
|
||||||
|
}
|
||||||
|
|
||||||
if (inventory.getItem(1).getJavaId() != javaOutput.getId()) {
|
if (inventory.getItem(1).getJavaId() != javaOutput.getId()) {
|
||||||
// We don't know there is an output here, so we tell ourselves that there is
|
// We don't know there is an output here, so we tell ourselves that there is
|
||||||
inventory.setItem(1, GeyserItemStack.from(javaOutput), session);
|
inventory.setItem(1, GeyserItemStack.from(javaOutput), session);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return translateRequest(session, inventory, request);
|
return translateRequest(session, inventory, request);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue