Optimized Crafting again. Current speed level: Super fast!

This commit is contained in:
0xSeb
2015-11-02 15:17:53 +01:00
parent 2da43ff690
commit 77b8f9c346
2 changed files with 26 additions and 9 deletions
@@ -57,6 +57,10 @@ public class CraftingManager extends ContainerManager {
// Get from output
} else if (isInteractionKeyDown()) {
if (Util.client.thePlayer.inventory.getItemStack() != null) {
moveStackToInventory(-1);
}
if (isStackKeyDown()) {
int oldStackSize = -1;
@@ -73,8 +77,9 @@ public class CraftingManager extends ContainerManager {
clickOnCraftingOutput();
}
// Move
} else if (slotIndex > 0 && currentHoveredSlot != null) {
// Move from hovered slot
} else if (slotIndex > 0 && currentHoveredSlot != null &&
Util.client.thePlayer.inventory.getItemStack() == null) {
if (isStackKeyDown()) {
moveAll(currentHoveredSlot.slotNumber, slotIndex);
@@ -83,8 +88,16 @@ public class CraftingManager extends ContainerManager {
move(currentHoveredSlot.slotNumber, slotIndex, 1);
}
// Handle NumKey-moving
// Handle NumKey-moving and held-moving
} else if (Util.client.thePlayer.inventory.getItemStack() != null) {
if (isStackKeyDown()) {
moveAll(-1, slotIndex);
moveStackToInventory(-1);
} else {
move(-1, slotIndex, 1);
}
handleNumKey();
}
}