From 1eefcda6ca21d81498aaa574417f18a4bd48145a Mon Sep 17 00:00:00 2001 From: Arcaratus Date: Mon, 11 May 2015 19:08:06 -0400 Subject: [PATCH] Fixed teleposers --- .../common/commands/CommandSN.java | 4 +-- .../container/ContainerTeleposer.java | 34 +++++++++--------- .../common/tileEntity/gui/GuiTeleposer.java | 7 ++-- .../alchemicalwizardry/gui/Teleposer.png | Bin 986 -> 1276 bytes 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java index 72fa59d7..8d7368e6 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/commands/CommandSN.java @@ -1,13 +1,11 @@ package WayofTime.alchemicalWizardry.common.commands; -import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; import java.util.List; @@ -99,7 +97,7 @@ public class CommandSN extends CommandBase } else if (astring.length == 2) { - return getListOfStringsMatchingLastWord(astring, "add", "subtract", "fill", "empty"); + return getListOfStringsMatchingLastWord(astring, "add", "subtract", "fill", "empty", "get"); } return null; diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java index 1a644e98..eeb19933 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/container/ContainerTeleposer.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity.container; +import WayofTime.alchemicalWizardry.common.items.TelepositionFocus; import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -14,7 +15,7 @@ public class ContainerTeleposer extends Container public ContainerTeleposer(InventoryPlayer inventoryPlayer, TETeleposer te) { tileEntity = te; - addSlotToContainer(new Slot(tileEntity, 0, 80, 67)); + addSlotToContainer(new Slot(tileEntity, 0, 80, 15)); bindPlayerInventory(inventoryPlayer); } @@ -30,13 +31,13 @@ public class ContainerTeleposer extends Container { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 140 + i * 18)); + addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 39 + i * 18)); } } for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 198)); + addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 97)); } } @@ -45,30 +46,27 @@ public class ContainerTeleposer extends Container { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); + int slots = inventorySlots.size(); + if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = stackInSlot.copy(); + System.out.println("Slots: " + slots); - if (slot == 7) + if (stack.getItem() instanceof TelepositionFocus) { - if (!this.mergeItemStack(stackInSlot, 7, 35, true)) + if (slot <= slots) + { + if (!this.mergeItemStack(stackInSlot, 0, slots, false)) + { + return null; + } + } + else if (!this.mergeItemStack(stackInSlot, slots, 36 + slots, false)) { return null; } - - slotObject.onSlotChange(stackInSlot, stack); - } - if (slot < 1) - { - if (!this.mergeItemStack(stackInSlot, 7, 35, true)) - { - return null; - } - } - else if (!this.mergeItemStack(stackInSlot, 0, 0, false)) - { - return null; } if (stackInSlot.stackSize == 0) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java index 450e63ac..35187582 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/tileEntity/gui/GuiTeleposer.java @@ -15,16 +15,16 @@ public class GuiTeleposer extends GuiContainer { super(new ContainerTeleposer(inventoryPlayer, tileEntity)); xSize = 176; - ySize = 222; + ySize = 121; } @Override protected void drawGuiContainerForegroundLayer(int param1, int param2) { //the parameters for drawString are: string, x, y, color - fontRendererObj.drawString("Teleposer", 8, 6, 4210752); + fontRendererObj.drawString("Teleposer", 64, 5, 4210752); //draws "Inventory" or your regional equivalent - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 130, 4210752); + fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 29, 4210752); } @Override @@ -37,6 +37,5 @@ public class GuiTeleposer extends GuiContainer int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - GuiBrewingStand d; } } \ No newline at end of file diff --git a/src/main/resources/assets/alchemicalwizardry/gui/Teleposer.png b/src/main/resources/assets/alchemicalwizardry/gui/Teleposer.png index 394b08ad78281189973442d0c0532e437a8abc9e..2efcbe9af374b8cd9d5fd027f2e1bf32fa1b86e9 100644 GIT binary patch literal 1276 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6&6|H(?D8gCb z5n0T@z;_6Q8AUa`8i0cAC7!;n?Dtu@c;xw3OK#lEz`)Y!>EaktaqI0}$GqECA`Tai zD|H(^$vwd>xS+N|@tf6*)Qyw1Tth;bCl_hFkWpCN|DUa-Sn=e!;;#K(2Mkr*FMLz* z)~x$)dBXnI6qf}PupY3K?`|Y0neE;Gzm6d((eSa)u(9w73t(^DxXU(kS zbEk{x#tJYc01H+srBBCdOFN8z5ulqZ=({q8sl* zOkKYF&+^{>4iC+xlZwlB6dcoT2=bC@JD6D@A;(}A;?-&Yo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