mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 18:27:41 +01:00
SPIGOT-5887: ClickType doesn't include off hand swaps
By: md_5 <git@md-5.net>
This commit is contained in:
parent
fe93691df2
commit
cfc8b4ad5e
@ -1310,8 +1310,8 @@
|
|||||||
+ }
|
+ }
|
||||||
+ break;
|
+ break;
|
||||||
+ case SWAP:
|
+ case SWAP:
|
||||||
+ if (packetplayinwindowclick.d() >= 0 && packetplayinwindowclick.d() < 9) {
|
+ if ((packetplayinwindowclick.d() >= 0 && packetplayinwindowclick.d() < 9) || packetplayinwindowclick.d() == 40) {
|
||||||
+ click = ClickType.NUMBER_KEY;
|
+ click = (packetplayinwindowclick.d() == 40) ? ClickType.SWAP_OFFHAND : ClickType.NUMBER_KEY;
|
||||||
+ Slot clickedSlot = this.player.activeContainer.getSlot(packetplayinwindowclick.c());
|
+ Slot clickedSlot = this.player.activeContainer.getSlot(packetplayinwindowclick.c());
|
||||||
+ if (clickedSlot.isAllowed(player)) {
|
+ if (clickedSlot.isAllowed(player)) {
|
||||||
+ ItemStack hotbar = this.player.inventory.getItem(packetplayinwindowclick.d());
|
+ ItemStack hotbar = this.player.inventory.getItem(packetplayinwindowclick.d());
|
||||||
|
Loading…
Reference in New Issue
Block a user