here is my GUI handler class
package somarani.soulcraft.gui;
import somarani.soulcraft.common.SoulCraft;
import somarani.soulcraft.tileentity.TileEntityInfuser;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
public class GuiHandler implements IGuiHandler {
public GuiHandler(){
NetworkRegistry.instance().registerGuiHandler(SoulCraft.instance, this);
}
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity != null)
{
switch (ID){
case SoulCraft.guiIdInfuser:
if (entity instanceof TileEntityInfuser){
return new ContainerInfuser(player.inventory, (TileEntityInfuser) entity);
}
}
}
return null;
}
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
int x, int y, int z) {
TileEntity entity = world.getBlockTileEntity(x, y, z);
if (entity != null)
{
switch (ID){
case SoulCraft.guiIdInfuser:
if (entity instanceof TileEntityInfuser){
return new GuiInfuser(player.inventory, (TileEntityInfuser) entity);
}
}
}
return null;
}
}