diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java index 49fd34b3..7a9da696 100644 --- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java @@ -20,17 +20,12 @@ import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode; @SideOnly(Side.CLIENT) public class GuiItemRoutingNode extends GuiContainer { - private GuiButton downButton; - private GuiButton upButton; - private GuiButton northButton; - private GuiButton southButton; - private GuiButton westButton; - private GuiButton eastButton; - private GuiButton incrementButton; - private GuiButton decrementButton; + private GuiButton downButton, upButton, northButton, southButton, westButton, eastButton, incrementButton, decrementButton; private TileFilteredRoutingNode inventory; + private int left, top; + public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) { super(new ContainerItemRoutingNode(playerInventory, tileRoutingNode)); @@ -54,15 +49,18 @@ public class GuiItemRoutingNode extends GuiContainer public void initGui() { super.initGui(); + left = (this.width - this.xSize) / 2; + top = (this.height - this.ySize)/ 2; + this.buttonList.clear(); - this.buttonList.add(this.downButton = new GuiButton(0, (this.width - this.xSize) / 2 + 133, (this.height - this.ySize) / 2 + 50, 18, 18, "D")); - this.buttonList.add(this.upButton = new GuiButton(1, (this.width - this.xSize) / 2 + 133, (this.height - this.ySize) / 2 + 14, 18, 18, "U")); - this.buttonList.add(this.northButton = new GuiButton(2, (this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 14, 18, 18, "N")); - this.buttonList.add(this.southButton = new GuiButton(3, (this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 50, 18, 18, "S")); - this.buttonList.add(this.westButton = new GuiButton(4, (this.width - this.xSize) / 2 + 133, (this.height - this.ySize) / 2 + 32, 18, 18, "W")); - this.buttonList.add(this.eastButton = new GuiButton(5, (this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 32, 18, 18, "E")); - this.buttonList.add(this.incrementButton = new GuiButton(6, (this.width - this.xSize) / 2 + 97, (this.height - this.ySize) / 2 + 14, 18, 17, "^")); - this.buttonList.add(this.decrementButton = new GuiButton(7, (this.width - this.xSize) / 2 + 97, (this.height - this.ySize) / 2 + 50, 18, 17, "v")); + this.buttonList.add(this.downButton = new GuiButton(0, left + 133, top + 50, 18, 17, "D")); + this.buttonList.add(this.upButton = new GuiButton(1, left + 133, top + 14, 18, 18, "U")); + this.buttonList.add(this.northButton = new GuiButton(2, left + 150, top + 14, 18, 18, "N")); + this.buttonList.add(this.southButton = new GuiButton(3, left + 150, top + 50, 18, 17, "S")); + this.buttonList.add(this.westButton = new GuiButton(4, left + 133, top + 32, 18, 18, "W")); + this.buttonList.add(this.eastButton = new GuiButton(5, left + 150, top + 32, 18, 18, "E")); + this.buttonList.add(this.incrementButton = new GuiButton(6, left + 97, top + 14, 18, 17, "^")); + this.buttonList.add(this.decrementButton = new GuiButton(7, left + 97, top + 50, 18, 17, "v")); disableDirectionalButton(inventory.currentActiveSlot); } @@ -109,8 +107,6 @@ public class GuiItemRoutingNode extends GuiContainer GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); ResourceLocation soulForgeGuiTextures = new ResourceLocation(Constants.Mod.MODID + ":textures/gui/routingNode.png"); this.mc.getTextureManager().bindTexture(soulForgeGuiTextures); - int i = (this.width - this.xSize) / 2; - int j = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + this.drawTexturedModalRect(left, top, 0, 0, this.xSize, this.ySize); } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java index d34d9177..e90c2370 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java @@ -65,7 +65,7 @@ public class ContainerItemRoutingNode extends Container { if (slotId >= 0) { - Slot slot = (Slot) this.inventorySlots.get(slotId); + Slot slot = this.inventorySlots.get(slotId); if (slot instanceof SlotGhostItem) //TODO: make the slot clicking work! { @@ -152,7 +152,7 @@ public class ContainerItemRoutingNode extends Container public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(index); + Slot slot = this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { @@ -184,7 +184,7 @@ public class ContainerItemRoutingNode extends Container if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); + slot.putStack(null); } else { slot.onSlotChanged(); diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java index 439cfa50..4fe6411d 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java @@ -42,7 +42,7 @@ public class ContainerSoulForge extends Container public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(index); + Slot slot = this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { @@ -76,7 +76,7 @@ public class ContainerSoulForge extends Container if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); + slot.putStack(null); } else { slot.onSlotChanged(); diff --git a/src/main/resources/assets/bloodmagic/textures/gui/routingNode.png b/src/main/resources/assets/bloodmagic/textures/gui/routingNode.png index 50dd39e7..80fc4bcf 100644 Binary files a/src/main/resources/assets/bloodmagic/textures/gui/routingNode.png and b/src/main/resources/assets/bloodmagic/textures/gui/routingNode.png differ