mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Ensure inventory affected slot is added in MOVE_TO_HOTBAR actions
This commit is contained in:
parent
9d908c5598
commit
c295e47940
1 changed files with 5 additions and 0 deletions
|
@ -28,6 +28,7 @@ package org.geysermc.geyser.inventory.click;
|
|||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerActionType;
|
||||
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType;
|
||||
import com.github.steveice10.mc.protocol.data.game.inventory.MoveToHotbarAction;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundContainerClickPacket;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
@ -381,6 +382,10 @@ public final class ClickPlan {
|
|||
for (ClickAction action : plan) {
|
||||
if (translator.getSlotType(action.slot) == SlotType.NORMAL && action.slot != Click.OUTSIDE_SLOT) {
|
||||
affectedSlots.add(action.slot);
|
||||
if (action.click.actionType == ContainerActionType.MOVE_TO_HOTBAR_SLOT) {
|
||||
//TODO won't work if offhand is added
|
||||
affectedSlots.add(inventory.getOffsetForHotbar(((MoveToHotbarAction) action.click.action).ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return affectedSlots;
|
||||
|
|
Loading…
Reference in a new issue