blob: 9412ed8983c55a6c0c990e9c9490c2e79eee6074 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package miscutil.core.handler;
import miscutil.core.gui.GUI_Bat_Buf;
import miscutil.core.gui.GUI_Battery_Buffer;
import miscutil.core.util.Utils;
import net.minecraft.entity.player.EntityPlayer;
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 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();
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+".");
if (ID == GUI1){
Utils.LOG_WARNING("Opening Gui with Id: "+ID);
return new GUI_Battery_Buffer();
}
else if (ID == GUI2){
Utils.LOG_WARNING("Opening Gui with Id: "+ID+" Energy Buffer");
return new GUI_Bat_Buf();
}
return null;
}
}
|