Added basic functionality. A lot of TODO's remaining.

This commit is contained in:
0xSeb
2015-02-02 12:57:10 +01:00
parent eb45b90b81
commit 8c898c78b0
3 changed files with 104 additions and 17 deletions
@@ -61,7 +61,7 @@ public class CraftingKeys {
proxy.registerRenderers();
FMLCommonHandler.instance().bus().register(this);
Helper.debugPrint("load(): Loaded Mod successful");
Helper.debugPrint("load(): Loaded CraftingKeys successful");
}
@@ -83,31 +83,35 @@ public class CraftingKeys {
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent tick) {
// if (mc.currentScreen != null) {
// if (mc.currentScreen instanceof
// net.minecraft.client.gui.inventory.GuiCrafting) {
// Keyboard.isKeyDown(Keyboard.KEY_Q)
// Case 1: Classic GUI Screen
if (Helper.isCraftingGUI(Helper.client.currentScreen)) {
// DEBUGGIN TEST START
GuiCrafting guiCrafting = (GuiCrafting) Helper.client.currentScreen;
Slot currentHoveredSlot = Helper.getSlotAtMousePosition(guiCrafting);
int keyDown = Helper.craftingKeyDownToSlotNumber();
if (Helper.client.currentScreen != null) {
if (Helper.client.currentScreen instanceof GuiCrafting) {
if (Keyboard.isKeyDown(Keyboard.KEY_C)) {
// Block Key Interval (avoid multiple Runs)
if (!Helper.isSameKey(keyDown)) {
GuiCrafting guiCrafting = (GuiCrafting) Helper.client.currentScreen;
Slot currentHoveredSlot = Helper.getSlotAtMousePosition(guiCrafting);
// Good key, Mouse over Inventory
if (keyDown != -1 && currentHoveredSlot != null) {
ContainerManager con = new ContainerManager(guiCrafting.inventorySlots);
if (currentHoveredSlot != null) {
con.move(currentHoveredSlot.slotNumber, 8, 1);
} else {
Helper.debugPrint("onTick(): Outside of inventory");
}
con.move(currentHoveredSlot.slotNumber, keyDown, 1);
// TODO: Move more/all!
// TODO: Strg -> Click on Output
// TODO: Shift -> Move all!
}
}
}
// DEBUGGIN TEST END
// Case 2: Inventory (2x2 Crafting, Quick-Armor)
// TODO: Case 2
}
}