diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-04-14 12:03:51 +0300 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-04-14 12:03:51 +0300 |
| commit | 4ea6a1052438ef1d8d42057d2a71755383166227 (patch) | |
| tree | 94def1bf66c59583d8e8aa7e3d1117a6f5b56b62 /eclipse/Jewelrycraft/common/darkknight/jewelrycraft/container/GuiHandler.java | |
| parent | 1a692ab45df3d88a6cc247cc9f4c0a41c7715264 (diff) | |
More updating
Diffstat (limited to 'eclipse/Jewelrycraft/common/darkknight/jewelrycraft/container/GuiHandler.java')
| -rw-r--r-- | eclipse/Jewelrycraft/common/darkknight/jewelrycraft/container/GuiHandler.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/container/GuiHandler.java b/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/container/GuiHandler.java new file mode 100644 index 0000000..3efe71c --- /dev/null +++ b/eclipse/Jewelrycraft/common/darkknight/jewelrycraft/container/GuiHandler.java @@ -0,0 +1,40 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.world.World; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import darkknight.jewelrycraft.JewelrycraftMod; +import darkknight.jewelrycraft.client.GuiGuide; +import darkknight.jewelrycraft.client.GuiRingChest; + +public class GuiHandler implements IGuiHandler +{ + public GuiHandler() + { + NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this); + } + + @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(); + default: return null; + } + } + + @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)); + case 1: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world); + default: return null; + } + } +} |
