diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-06-16 03:59:47 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-06-16 03:59:47 +1000 |
commit | 51d5db94cfafac652a05f6f121ec2521d62aaf5c (patch) | |
tree | 8e622e427fa6416b5ca508ed4deb8e10e783f9d1 /src/Java/miscutil/core/handler | |
parent | d3f4786befad33f4ec77723bf4470d05f9f862ec (diff) | |
download | GT5-Unofficial-51d5db94cfafac652a05f6f121ec2521d62aaf5c.tar.gz GT5-Unofficial-51d5db94cfafac652a05f6f121ec2521d62aaf5c.tar.bz2 GT5-Unofficial-51d5db94cfafac652a05f6f121ec2521d62aaf5c.zip |
Done a lot of work on the NFHG.
Also did some more refactoring beforehand.
Diffstat (limited to 'src/Java/miscutil/core/handler')
-rw-r--r-- | src/Java/miscutil/core/handler/GuiHandler.java | 27 | ||||
-rw-r--r-- | src/Java/miscutil/core/handler/events/PickaxeBlockBreakEventHandler.java | 2 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/Java/miscutil/core/handler/GuiHandler.java b/src/Java/miscutil/core/handler/GuiHandler.java index 951b697aab..67200c6cf3 100644 --- a/src/Java/miscutil/core/handler/GuiHandler.java +++ b/src/Java/miscutil/core/handler/GuiHandler.java @@ -1,36 +1,53 @@ package miscutil.core.handler; +import miscutil.core.container.Container_NHG; +import miscutil.core.gui.machine.GUI_NHG; +import miscutil.core.tileentities.TileEntityNHG; import miscutil.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { - private static final int GUI1 = 0; //Nothing Yet + private static final int GUI1 = 0; //Nuclear Helium Gen. private static final int GUI2 = 1; //Energy Buffer @Override //ContainerModTileEntity public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if (ID == GUI1){} - //return new GUI_Battery_Buffer(); + TileEntity te = world.getTileEntity(x, y, z); + if (te != null){ + if (ID == GUI1){ + return new Container_NHG((TileEntityNHG)te, player); + } + else if (ID == GUI2){ + + } + + + + } return null; } @Override //GuiModTileEntity public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { Utils.LOG_WARNING("getClientGuiElement Called by: "+player+", in world: "+player.dimension+" at x:"+x+", y:"+y+", z:"+z+"."); + TileEntity te = world.getTileEntity(x, y, z); + if (te != null){ if (ID == GUI1){ - Utils.LOG_WARNING("Opening Gui with Id: "+ID); - //return new GUI_Battery_Buffer(); + Utils.LOG_WARNING("Opening Gui with Id: "+ID+" NHG"); + return new GUI_NHG((TileEntityNHG) te, player); } else if (ID == GUI2){ Utils.LOG_WARNING("Opening Gui with Id: "+ID+" Energy Buffer"); //return new GUI_Bat_Buf(); } + } return null; } diff --git a/src/Java/miscutil/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/Java/miscutil/core/handler/events/PickaxeBlockBreakEventHandler.java index 9169249136..524adfc97f 100644 --- a/src/Java/miscutil/core/handler/events/PickaxeBlockBreakEventHandler.java +++ b/src/Java/miscutil/core/handler/events/PickaxeBlockBreakEventHandler.java @@ -59,7 +59,7 @@ public class PickaxeBlockBreakEventHandler { @SubscribeEvent public void onPlayerInteraction(PlayerInteractEvent aEvent) { if (aEvent.entityPlayer != null && aEvent.entityPlayer.worldObj != null && aEvent.action != null && aEvent.world.provider != null && !aEvent.entityPlayer.worldObj.isRemote && aEvent.action != null && aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) { - Utils.LOG_ERROR("Test"); + //Utils.LOG_ERROR("Test"); } } } |