forked from GeyserMC/Geyser
Update JavaSetSlotTranslator.java
This commit is contained in:
parent
8ae803b9a5
commit
06358b2449
1 changed files with 9 additions and 11 deletions
|
@ -55,7 +55,6 @@ 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());
|
||||||
|
@ -64,8 +63,7 @@ public class JavaSetSlotTranslator extends PacketTranslator<ServerSetSlotPacket>
|
||||||
}
|
}
|
||||||
ContainerClosePacket closePacket = new ContainerClosePacket();
|
ContainerClosePacket closePacket = new ContainerClosePacket();
|
||||||
closePacket.setWindowId((byte) inventory.getId());
|
closePacket.setWindowId((byte) inventory.getId());
|
||||||
session.getUpstream().sendPacket(closePacket);
|
Geyser.getGeneralThreadPool().schedule(() -> session.getUpstream().sendPacket(closePacket), 150, TimeUnit.MILLISECONDS);
|
||||||
}, 150, TimeUnit.MILLISECONDS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
session.getInventory().setCursor(packet.getItem());
|
session.getInventory().setCursor(packet.getItem());
|
||||||
|
|
Loading…
Reference in a new issue