Fixed: Moving a held item to hotbar slot.

This commit is contained in:
Alexander Albers
2015-11-02 13:51:21 +01:00
parent f08cc9b591
commit af0baf959c
2 changed files with 9 additions and 3 deletions
@@ -32,7 +32,9 @@ public abstract class ContainerManager {
protected void handleNumKey() {
int hotbarStartIndex = 0;
// see: http://wiki.vg/Inventory
// hotbar-slots are always the last 9 slots of the currently opened inventory.
int hotbarStartIndex = Util.client.thePlayer.openContainer.getInventory().size() - 9 - 1;
if (Keyboard.isKeyDown(Keyboard.KEY_1)) {
leftClick(hotbarStartIndex + 1);
@@ -55,7 +57,12 @@ public abstract class ContainerManager {
} else {
return;
}
moveStackToInventory(-1);
// Minecraft handles the Keyboard-keys as well, that's why we need to clear them first
// see: GuiContainer#keyTyped(char,int); -> checkHotbarKeys
while (Keyboard.next()) {
}
}
/**