mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Update JavaSetSlotTranslator.java
This commit is contained in:
parent
8ae803b9a5
commit
06358b2449
1 changed files with 9 additions and 11 deletions
|
@ -55,17 +55,15 @@ public class JavaSetSlotTranslator extends PacketTranslator<ServerSetSlotPacket>
|
||||||
cursorPacket.setSlot(ItemData.AIR);
|
cursorPacket.setSlot(ItemData.AIR);
|
||||||
session.getUpstream().sendPacket(cursorPacket);
|
session.getUpstream().sendPacket(cursorPacket);
|
||||||
|
|
||||||
Geyser.getGeneralThreadPool().schedule(() -> {
|
Inventory inventory = session.getInventoryCache().getOpenInventory();
|
||||||
Inventory inventory = session.getInventoryCache().getOpenInventory();
|
if (inventory != null) {
|
||||||
if (inventory != null) {
|
session.setReopeningWindow(inventory.getId());
|
||||||
session.setReopeningWindow(inventory.getId());
|
} else {
|
||||||
} else {
|
inventory = session.getInventory();
|
||||||
inventory = session.getInventory();
|
}
|
||||||
}
|
ContainerClosePacket closePacket = new ContainerClosePacket();
|
||||||
ContainerClosePacket closePacket = new ContainerClosePacket();
|
closePacket.setWindowId((byte) inventory.getId());
|
||||||
closePacket.setWindowId((byte) inventory.getId());
|
Geyser.getGeneralThreadPool().schedule(() -> session.getUpstream().sendPacket(closePacket), 150, TimeUnit.MILLISECONDS);
|
||||||
session.getUpstream().sendPacket(closePacket);
|
|
||||||
}, 150, TimeUnit.MILLISECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
session.getInventory().setCursor(packet.getItem());
|
session.getInventory().setCursor(packet.getItem());
|
||||||
|
|
Loading…
Reference in a new issue