diff options
author | Detrav <witalyezep@gmail.com> | 2016-04-07 16:52:55 +0300 |
---|---|---|
committer | Detrav <witalyezep@gmail.com> | 2016-04-07 16:52:55 +0300 |
commit | a2229132fe8b7f9a2927e827f828a8989c02851b (patch) | |
tree | 772defa2d1ffc92e36b1a6ccc6b58cb0553f102b /src/main/java/com/detrav/proxies/CommonProxy.java | |
parent | 75a60a12494da3593aa77d9de193b328691ae8aa (diff) | |
download | GT5-Unofficial-a2229132fe8b7f9a2927e827f828a8989c02851b.tar.gz GT5-Unofficial-a2229132fe8b7f9a2927e827f828a8989c02851b.tar.bz2 GT5-Unofficial-a2229132fe8b7f9a2927e827f828a8989c02851b.zip |
Add gui to charger, refactor
Diffstat (limited to 'src/main/java/com/detrav/proxies/CommonProxy.java')
-rw-r--r-- | src/main/java/com/detrav/proxies/CommonProxy.java | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/main/java/com/detrav/proxies/CommonProxy.java b/src/main/java/com/detrav/proxies/CommonProxy.java index 52a3e11e26..7e32670b81 100644 --- a/src/main/java/com/detrav/proxies/CommonProxy.java +++ b/src/main/java/com/detrav/proxies/CommonProxy.java @@ -1,7 +1,10 @@ package com.detrav.proxies; +import com.detrav.DetravScannerMod; import com.detrav.enums.DetravSimpleItems; import com.detrav.gui.DetravGuiProPick; +import com.detrav.gui.containers.DetravPortableChargerContainer; +import com.detrav.gui.DetravPortableChargerGui; import cpw.mods.fml.common.network.IGuiHandler; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -35,18 +38,35 @@ public class CommonProxy implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - return null; + switch (ID) { + case DetravGuiProPick.GUI_ID: + return null; + case DetravPortableChargerGui.GUI_ID: + return new DetravPortableChargerContainer(player.inventory,world); + default: + return null; + } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if(ID == DetravGuiProPick.GUI_ID) - return new DetravGuiProPick(); - return null; + switch (ID) { + case DetravGuiProPick.GUI_ID: + return new DetravGuiProPick(); + case DetravPortableChargerGui.GUI_ID: + return new DetravPortableChargerGui(player.inventory,world); + default: + return null; + } } public void openProPickGui() { } + + public void openPortableChargerGui(EntityPlayer player) + { + player.openGui(DetravScannerMod.instance, DetravPortableChargerGui.GUI_ID,player.worldObj,(int)player.posX,(int)player.posY,(int)player.posZ); + } } |