Merge pull request #7 from 5zig/master
Fixed: Moving a held item to hotbar slot.
This commit is contained in:
@@ -32,7 +32,9 @@ public abstract class ContainerManager {
|
|||||||
|
|
||||||
protected void handleNumKey() {
|
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)) {
|
if (Keyboard.isKeyDown(Keyboard.KEY_1)) {
|
||||||
leftClick(hotbarStartIndex + 1);
|
leftClick(hotbarStartIndex + 1);
|
||||||
@@ -55,7 +57,12 @@ public abstract class ContainerManager {
|
|||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
moveStackToInventory(-1);
|
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()) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ public class CraftingManager extends ContainerManager {
|
|||||||
|
|
||||||
// Handle NumKey-moving
|
// Handle NumKey-moving
|
||||||
} else if (Util.client.thePlayer.inventory.getItemStack() != null) {
|
} else if (Util.client.thePlayer.inventory.getItemStack() != null) {
|
||||||
Logger.warn("acceptKey()", "NumKey-Moving does not work yet. Will probably work never.");
|
handleNumKey();
|
||||||
//handleNumKey();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user