From 4f7ad220df0438b6f3382110577b53f29da46453 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 24 May 2018 15:50:07 -0400 Subject: Update of all changes --- .../jewelrycraft/client/gui/GuiHandler.java | 169 ++++++++++++--------- 1 file changed, 95 insertions(+), 74 deletions(-) mode change 100644 => 100755 src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java (limited to 'src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java') diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java old mode 100644 new mode 100755 index 0218886..ae21f08 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java @@ -16,78 +16,99 @@ import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -public class GuiHandler implements IGuiHandler -{ - ResourceLocation pageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePage.png"); - ResourceLocation flippedPageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png"); - ResourceLocation chestTexture = new ResourceLocation(Variables.MODID, "textures/gui/chest_ring.png"); - ResourceLocation jewelryInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_tab.png"); - ResourceLocation cursesInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses_tab.png"); - ResourceLocation jewlryModTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_modifier.png"); - - /** - * - */ - public GuiHandler() - { - NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this); - } - - /** - * @param ID - * @param player - * @param world - * @param x - * @param y - * @param z - * @return - */ - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - switch(ID) - { - case 0: - return new ContainerRingChest(player.inventory, (TileEntityChest)world.getTileEntity(x, y, z)); - case 1: - return new ContainerGuide(); - case 2: - return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)); - case 3: - return new ContainerJewelryModifier(player.inventory, new InventoryBasic("ItemModifier", false, 37)); - case 4: - return new ContainerCurseInfo(); - default: - return null; - } - } - - /** - * @param ID - * @param player - * @param world - * @param x - * @param y - * @param z - * @return - */ - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - switch(ID) - { - case 0: - return new GuiRingChest((ContainerRingChest)getServerGuiElement(ID, player, world, x, y, z), chestTexture); - case 1: - return new GuiGuide((ContainerGuide)getServerGuiElement(ID, player, world, x, y, z), world, pageTexture, flippedPageTexture); - case 2: - return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)), jewelryInvTexture); - case 3: - return new GuiJewelryModifier((ContainerJewelryModifier)getServerGuiElement(ID, player, world, x, y, z), jewlryModTexture); - case 4: - return new GuiCurseInfo((ContainerCurseInfo)getServerGuiElement(ID, player, world, x, y, z), world, player, cursesInvTexture); - default: - return null; - } - } +public class GuiHandler implements IGuiHandler { + ResourceLocation pageTexture = new ResourceLocation( + Variables.MODID, "textures/gui/guidePage.png"); + ResourceLocation flippedPageTexture = new ResourceLocation( + Variables.MODID, "textures/gui/guidePageFlip.png"); + ResourceLocation chestTexture = new ResourceLocation( + Variables.MODID, "textures/gui/chest_ring.png"); + ResourceLocation jewelryInvTexture = new ResourceLocation( + Variables.MODID, "textures/gui/jewelry_tab.png"); + ResourceLocation cursesInvTexture = new ResourceLocation( + Variables.MODID, "textures/gui/curses_tab.png"); + ResourceLocation jewlryModTexture = new ResourceLocation( + Variables.MODID, "textures/gui/jewelry_modifier.png"); + + /** + * + */ + public GuiHandler() { + NetworkRegistry.INSTANCE + .registerGuiHandler(JewelrycraftMod.instance, this); + } + + /** + * @param ID + * @param player + * @param world + * @param x + * @param y + * @param z + * @return + */ + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, + World world, int x, int y, int z) { + switch (ID) { + case 0: + return new ContainerRingChest(player.inventory, + (TileEntityChest) world.getTileEntity(x, y, z)); + case 1: + return new ContainerGuide(); + case 2: + return new ContainerJewelryTab(player, player.inventory, + new JewelryInventory(player)); + case 3: + return new ContainerJewelryModifier(player.inventory, + new InventoryBasic("ItemModifier", false, 37)); + case 4: + return new ContainerCurseInfo(); + default: + return null; + } + } + + /** + * @param ID + * @param player + * @param world + * @param x + * @param y + * @param z + * @return + */ + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, + World world, int x, int y, int z) { + switch (ID) { + case 0: + return new GuiRingChest( + (ContainerRingChest) getServerGuiElement(ID, + player, world, x, y, z), + chestTexture); + case 1: + return new GuiGuide( + (ContainerGuide) getServerGuiElement(ID, player, + world, x, y, z), + world, pageTexture, flippedPageTexture); + case 2: + return new GuiJewelry( + new ContainerJewelryTab(player, player.inventory, + new JewelryInventory(player)), + jewelryInvTexture); + case 3: + return new GuiJewelryModifier( + (ContainerJewelryModifier) getServerGuiElement(ID, + player, world, x, y, z), + jewlryModTexture); + case 4: + return new GuiCurseInfo( + (ContainerCurseInfo) getServerGuiElement(ID, + player, world, x, y, z), + world, player, cursesInvTexture); + default: + return null; + } + } } -- cgit v1.2.3