well if you have a Gui that has a "container" yea you will need that.
wait a sec
public class R2S_GuiHandler implements IGuiHandler {
private GameSettings sets;
/**test
public void onKeyInput(InputEvent.KeyInputEvent event, EntityPlayer speler, World wereld,int x, int y, int z) {
if(ToetsenBinden.pong.isPressed())
speler.openGui(R2S_UsefulBlocks.instance, 1, wereld, x, y, z);
} **/
public enum GUIIDS{
guiRadio;
}
public Object getClientGuiElement(int ID, EntityPlayer speler, World wereld,int x, int y, int z) {
TileEntity tileentity = wereld.getTileEntity(new BlockPos(x, y, z));
// speler.getPersistentID();
/**if(ToetsenBinden.inventaries.isPressed()){
System.out.println("test bctGuihandler guiharnas");
speler.openGui(R2S_UsefulBlocks.instance, Constante.guiHarnas, wereld, x, y, z);} **/
/*switch(GUIIDS.values()[ID]){
case guiRadio:
if(tileentity instanceof TERadio){
return new GuiRadio(speler.inventory,(TERadio)tileentity);
}
}*/
switch(ID){
case Constante.guiRadio:
if(tileentity instanceof TERadio){
return new GuiRadio(speler.inventory,speler,(TERadio)tileentity,wereld,x,y,z);
}
break;
case Constante.guiJukeBox:
if(tileentity instanceof TEjukeBox){
return new GuiJukeBox(speler.inventory,speler,(TEjukeBox)tileentity,wereld,x,y,z);
}
break;
}
throw new IllegalArgumentException("["+Constante.MODNAME+"] no Correct GUI ID : "+ID);
}
public Object getServerGuiElement(int ID, EntityPlayer speler, World wereld, int x, int y, int z) {
TileEntity tileentity = wereld.getTileEntity(new BlockPos(x, y, z));
//speler.getPersistentID();
/**if (ToetsenBinden.inventaries.isPressed()){
System.out.println("test bctGuihandler guiharnas");
speler.openGui(R2S_UsefulBlocks.instance, Constante.guiHarnas, wereld, x, y, z);} **/
/*switch(GUIIDS.values()[ID]){
case guiRadio:
if(tileentity instanceof TERadio){
return new ContainerRadio(speler.inventory,(TERadio)tileentity);
}
}*/
switch(ID){
case Constante.guiRadio:
if(tileentity instanceof TERadio){
return new ContainerRadio(speler.inventory,(TERadio)tileentity,speler);
}
break;
case Constante.guiJukeBox:
if(tileentity instanceof TEjukeBox){
return new ContainerRadio(speler.inventory,(TEjukeBox)tileentity,speler);
}
break;
}
throw new IllegalArgumentException("["+Constante.MODNAME+"] no Correct GUI ID "+ID);
}
/**public static void InventariesInit(EntityPlayer speler,World wereld,int x,int y, int z){
if (ToetsenBinden.inventaries.isPressed())
System.out.println("toets inventaries werkt");
FMLNetworkHandler.openGui(speler, R2S_UsefulBlocks.instance,Constante.guiRadio, wereld, x, y, z);
if(Keyboard.isKeyDown(25))
System.out.println("lol key25");
}**/
}
this is a direct copy if my class hope you have enough