diff options
| author | Lance5057 <Lance5057@gmail.com> | 2015-02-09 08:04:46 -0600 |
|---|---|---|
| committer | Lance5057 <Lance5057@gmail.com> | 2015-02-09 08:04:46 -0600 |
| commit | 0fe568fc1800274fa3f0c68a09e0ad8d6b5e3e62 (patch) | |
| tree | 32770788690fc72e2a147c80e732647f1c4ffa09 /src/main/java/gmail/Lance5057/proxy/CommonProxy.java | |
| parent | d0dd1569124f26af121ba0a8bf039b1157006579 (diff) | |
Attempt at making crest mount have an inventory.
A failed attempt
Diffstat (limited to 'src/main/java/gmail/Lance5057/proxy/CommonProxy.java')
| -rw-r--r-- | src/main/java/gmail/Lance5057/proxy/CommonProxy.java | 42 |
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 |
