summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/container/GuiHandler.java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-04-02 17:44:09 +0300
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2014-04-02 17:44:09 +0300
commitdbe39cf7e6ddc6c6fd1e639b495a8ac568e081a9 (patch)
tree7d8dd11ff240e350d3495ac8bf297659b4bcb026 /common/darkknight/jewelrycraft/container/GuiHandler.java
parenteb32c0b97d9f3dddace4ffb1a4eb0617e4f63225 (diff)
Fixed some bugs!
Diffstat (limited to 'common/darkknight/jewelrycraft/container/GuiHandler.java')
-rw-r--r--common/darkknight/jewelrycraft/container/GuiHandler.java38
1 files changed, 8 insertions, 30 deletions
diff --git a/common/darkknight/jewelrycraft/container/GuiHandler.java b/common/darkknight/jewelrycraft/container/GuiHandler.java
index 6e1a78a..70ff5f7 100644
--- a/common/darkknight/jewelrycraft/container/GuiHandler.java
+++ b/common/darkknight/jewelrycraft/container/GuiHandler.java
@@ -11,13 +11,6 @@ import darkknight.jewelrycraft.client.GuiRingChest;
public class GuiHandler implements IGuiHandler
{
- public static enum GuiId {
- ringChest,
- guide;
-
- public static final GuiId[] VALUES = GuiId.values();
- }
-
public GuiHandler()
{
NetworkRegistry.instance().registerGuiHandler(JewelrycraftMod.instance, this);
@@ -25,38 +18,23 @@ public class GuiHandler implements IGuiHandler
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- final GuiId guiId = getGuiId(ID);
- if (guiId == null) return null;
- switch(guiId)
+ {
+ switch(ID)
{
- case ringChest: return new ContainerRingChest(player.inventory, (TileEntityChest) world.getBlockTileEntity(x, y, z));
- case guide: return new ContainerGuide();
+ case 0: return new ContainerRingChest(player.inventory, (TileEntityChest) world.getBlockTileEntity(x, y, z));
+ case 1: return new ContainerGuide();
default: return null;
}
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- final GuiId guiId = getGuiId(ID);
- if (guiId == null) return null;
- switch(guiId)
+ {
+ switch(ID)
{
- case ringChest: return new GuiRingChest((ContainerRingChest) getServerGuiElement(ID, player, world, x, y, z));
- case guide: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world);
+ case 0: return new GuiRingChest((ContainerRingChest) getServerGuiElement(ID, player, world, x, y, z));
+ case 1: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world);
default: return null;
}
}
-
- private static GuiId getGuiId(int id) {
- try
- {
- return GuiId.VALUES[id];
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- return null;
- }
- }
}