diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-09-17 19:10:05 +0300 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-09-17 19:10:05 +0300 |
| commit | 06f62473f0622efe6decc32b70516a7c5d3d3572 (patch) | |
| tree | ebf54c96117f9917cd93740a89763c26abde06af /java/darkknight/jewelrycraft/container/GuiHandler.java | |
| parent | 852cfd0e13631320624d528213ec8c80cffe8743 (diff) | |
1.7.10
Diffstat (limited to 'java/darkknight/jewelrycraft/container/GuiHandler.java')
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiHandler.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/java/darkknight/jewelrycraft/container/GuiHandler.java b/java/darkknight/jewelrycraft/container/GuiHandler.java new file mode 100644 index 0000000..cd9d72e --- /dev/null +++ b/java/darkknight/jewelrycraft/container/GuiHandler.java @@ -0,0 +1,46 @@ +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; + } + } +} |
