From 1a3455b24d90b0def912c28467cbc51662d660e0 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Thu, 26 Dec 2013 00:50:16 +0200 Subject: Major changes. Thanks domi for helping me with the chest linking ring :) --- .../jewelrycraft/container/GuiHandler.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 common/darkknight/jewelrycraft/container/GuiHandler.java (limited to 'common/darkknight/jewelrycraft/container/GuiHandler.java') diff --git a/common/darkknight/jewelrycraft/container/GuiHandler.java b/common/darkknight/jewelrycraft/container/GuiHandler.java new file mode 100644 index 0000000..a0afc3f --- /dev/null +++ b/common/darkknight/jewelrycraft/container/GuiHandler.java @@ -0,0 +1,30 @@ +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.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) + { + return new ContainerRingChest(player.inventory, (TileEntityChest) world.getBlockTileEntity(x, y, z)); + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + return new GuiRingChest((ContainerRingChest) getServerGuiElement(ID, player, world, x, y, z)); + } + +} -- cgit v1.2.3