Wasted a lot of time trying to move an held item to a hotbar slot. But the indices of the crafting slot are the same. I do not understand if / how InvTweaks solves this problem. Probably never gonna work -.-
This commit is contained in:
@@ -7,9 +7,7 @@ Crafting Keys is a modification which adds a lot of new key bindings to minecraf
|
|||||||
|
|
||||||
The whole project had been refactored and is now almost ready to be release. But there are missing a few things:
|
The whole project had been refactored and is now almost ready to be release. But there are missing a few things:
|
||||||
- Better Log Output
|
- Better Log Output
|
||||||
- Unit Tests
|
|
||||||
- Implementing all vanilla guis
|
- Implementing all vanilla guis
|
||||||
- Add number compr.
|
|
||||||
- Better, all new GUI
|
- Better, all new GUI
|
||||||
|
|
||||||
## More Information
|
## More Information
|
||||||
|
|||||||
@@ -30,6 +30,34 @@ public abstract class ContainerManager {
|
|||||||
*/
|
*/
|
||||||
public abstract void acceptKey();
|
public abstract void acceptKey();
|
||||||
|
|
||||||
|
protected void handleNumKey() {
|
||||||
|
|
||||||
|
int hotbarStartIndex = 0;
|
||||||
|
|
||||||
|
if (Keyboard.isKeyDown(Keyboard.KEY_1)) {
|
||||||
|
leftClick(hotbarStartIndex + 1);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_2)) {
|
||||||
|
leftClick(hotbarStartIndex + 2);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_3)) {
|
||||||
|
leftClick(hotbarStartIndex + 3);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_4)) {
|
||||||
|
leftClick(hotbarStartIndex + 4);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_5)) {
|
||||||
|
leftClick(hotbarStartIndex + 5);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_6)) {
|
||||||
|
leftClick(hotbarStartIndex + 6);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_7)) {
|
||||||
|
leftClick(hotbarStartIndex + 7);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_8)) {
|
||||||
|
leftClick(hotbarStartIndex + 8);
|
||||||
|
} else if (Keyboard.isKeyDown(Keyboard.KEY_9)) {
|
||||||
|
leftClick(hotbarStartIndex + 9);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
moveStackToInventory(-1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts the first specific pressed Key to the slot in a given Inventory.
|
* Converts the first specific pressed Key to the slot in a given Inventory.
|
||||||
* Does also accept Interaction (mapped to -101) and drop key (mapped to -102).
|
* Does also accept Interaction (mapped to -101) and drop key (mapped to -102).
|
||||||
|
|||||||
@@ -47,12 +47,14 @@ public class CraftingManager extends ContainerManager {
|
|||||||
|
|
||||||
if (!InputUtil.isSameKey(slotIndex)) {
|
if (!InputUtil.isSameKey(slotIndex)) {
|
||||||
|
|
||||||
|
// Drop
|
||||||
if (isDropKeyDown()) {
|
if (isDropKeyDown()) {
|
||||||
|
|
||||||
for (int i = 1; i < 10; i++) {
|
for (int i = 1; i < 10; i++) {
|
||||||
moveStackToInventory(i);
|
moveStackToInventory(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get from output
|
||||||
} else if (isInteractionKeyDown()) {
|
} else if (isInteractionKeyDown()) {
|
||||||
|
|
||||||
if (isStackKeyDown()) {
|
if (isStackKeyDown()) {
|
||||||
@@ -71,6 +73,7 @@ public class CraftingManager extends ContainerManager {
|
|||||||
clickOnCraftingOutput();
|
clickOnCraftingOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Move
|
||||||
} else if (slotIndex > 0 && currentHoveredSlot != null) {
|
} else if (slotIndex > 0 && currentHoveredSlot != null) {
|
||||||
|
|
||||||
if (isStackKeyDown()) {
|
if (isStackKeyDown()) {
|
||||||
@@ -79,6 +82,11 @@ public class CraftingManager extends ContainerManager {
|
|||||||
} else {
|
} else {
|
||||||
move(currentHoveredSlot.slotNumber, slotIndex, 1);
|
move(currentHoveredSlot.slotNumber, slotIndex, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle NumKey-moving
|
||||||
|
} else if (Util.client.thePlayer.inventory.getItemStack() != null) {
|
||||||
|
Logger.warn("acceptKey()", "NumKey-Moving does not work yet. Will probably work never.");
|
||||||
|
//handleNumKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user