summaryrefslogtreecommitdiff
path: root/src/main/java/gmail/Lance5057/proxy/CommonProxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gmail/Lance5057/proxy/CommonProxy.java')
-rw-r--r--src/main/java/gmail/Lance5057/proxy/CommonProxy.java42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/main/java/gmail/Lance5057/proxy/CommonProxy.java b/src/main/java/gmail/Lance5057/proxy/CommonProxy.java
index 164bf21..1b2ff1e 100644
--- a/src/main/java/gmail/Lance5057/proxy/CommonProxy.java
+++ b/src/main/java/gmail/Lance5057/proxy/CommonProxy.java
@@ -1,8 +1,15 @@
package gmail.Lance5057.proxy;
+import gmail.Lance5057.blocks.TileEntity_CrestMount;
+import gmail.Lance5057.com.mod_TinkersDefense;
+import gmail.Lance5057.gui.Container_CrestMount;
+import gmail.Lance5057.gui.Gui_CrestMount;
import net.minecraft.client.model.ModelBiped;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.network.IGuiHandler;
-public class CommonProxy {
+public class CommonProxy implements IGuiHandler {
// Client stuff
public void registerRenderers() {
@@ -17,5 +24,34 @@ public class CommonProxy {
public ModelBiped getArmorModel(int id)
{
return null;
- }
-} \ No newline at end of file
+ }
+
+ public World getClientWorld()
+ {
+ return null;
+ }
+
+ @Override
+ public Object getServerGuiElement(int ID, EntityPlayer player,
+ World world, int x, int y, int z) {
+ // Hooray, no 'magic' numbers - we know exactly which Gui this refers to
+ if (ID == mod_TinkersDefense.GUI_ITEM_INV)
+ {
+ // Use the player's held item to create the inventory
+ return new Container_CrestMount(player.inventory, new TileEntity_CrestMount());
+ }
+ return null;
+ }
+
+ @Override
+ public Object getClientGuiElement(int ID, EntityPlayer player,
+ World world, int x, int y, int z) {
+ if (ID == mod_TinkersDefense.GUI_ITEM_INV)
+ {
+ // We have to cast the new container as our custom class
+ // and pass in currently held item for the inventory
+ return new Gui_CrestMount((Container_CrestMount) new Container_CrestMount(player.inventory, new TileEntity_CrestMount()));
+ }
+ return null;
+ }
+ } \ No newline at end of file