3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

SPIGOT-5887: ClickType doesn't include off hand swaps

Dieser Commit ist enthalten in:
md_5 2020-06-30 11:43:15 +10:00
Ursprung 23aac2a53f
Commit e09dbecab8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: E8E901AC7C617C11

Datei anzeigen

@ -1310,8 +1310,8 @@
+ }
+ break;
+ case SWAP:
+ if (packetplayinwindowclick.d() >= 0 && packetplayinwindowclick.d() < 9) {
+ click = ClickType.NUMBER_KEY;
+ if ((packetplayinwindowclick.d() >= 0 && packetplayinwindowclick.d() < 9) || packetplayinwindowclick.d() == 40) {
+ click = (packetplayinwindowclick.d() == 40) ? ClickType.SWAP_OFFHAND : ClickType.NUMBER_KEY;
+ Slot clickedSlot = this.player.activeContainer.getSlot(packetplayinwindowclick.c());
+ if (clickedSlot.isAllowed(player)) {
+ ItemStack hotbar = this.player.inventory.getItem(packetplayinwindowclick.d());