A bigger issue is that you are returning the vanilla Container and Gui classes for the vanilla Furnace. That is likely not going to work the way you expect. If your TileEntity extends TileEntityFurnace, it might work, but usually you return your own implementations.
The post i linked is a 1.7.10 tutorial of sorts. Yes you have to do some work your self and get the container and gui classes but that's simple. I don't believe you can learn just by copying and pasting code which is why I didn't just put the full class in that post.
I said in the post to change the OnBlockActivated method in the block class to
@Override
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
if (tileentity instanceof TileEntityGrinder)
{
playerIn.displayGUIChest((TileEntityGrinder)tileentity);
}
return true;
}
}
It opens with this one not your part of code....it dose not open nor it acts like it has any slots...i can place anything on it without holding shift+ right click ....i can't do that on ordinary furnace...cuz when i right click without holding shift it opens gui
If you had read what i told you to do properly it will work.
Firstly The @Instance is wrong as its supposed to be @Instance(ModID) not @Instance(main)
Secondly "NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());" should not be in the FMLInitializationEvent method and should be "new GUIHandler();" instead
Thirdly "NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, this);" should be in a public constructor in the GUIHandler class.
Block MachineGrinder : http://pastebin.com/W0wFMrbL
GuiHandler : http://pastebin.com/shZhivVa
GuiGrinder: http://pastebin.com/Af1wqQKk
GrinderContainer: http://pastebin.com/sgdKqkhy
All i get is My inventory and above "container:furnace" without ""
Now what? where is the error?
@Override
public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
p_149727_5_.openGui(NameOfYourMainClass.instance, 0, p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);
return true;
}
public static final int GuiIDGrinder = 0;
Then i call BlockList.GuiIDGrinder casue it's initlized in blockList class....do you understand that?
public boolean onBlockActivated(World worldIn,BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ){
if (worldIn.isRemote)
{
return true;
}
else
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityGrinder)
{
playerIn.displayGUIChest((TileEntityGrinder)tileentity);
}
return true;
}
}
It opens with this one not your part of code....it dose not open nor it acts like it has any slots...i can place anything on it without holding shift+ right click ....i can't do that on ordinary furnace...cuz when i right click without holding shift it opens gui
and with my part of code it opens thos
Block Class : http://pastebin.com/r1trWicy
MainClass: http://pastebin.com/hS3PMCE3
BlockList:http://pastebin.com/UwQ8BScj
GrinderBlock : http://pastebin.com/ with Ohms Code that makes my block acts like block if used code below it turns into picture above
TileEnitty of Grinder: http://pastebin.com/hKvqyuHm
GuiHandler: http://pastebin.com/Jy88DkWq
Gui Grinder: http://pastebin.com/VXqLgJxr
Container: http://pastebin.com/v7vG635A
My on block Activated makes picture above
public boolean onBlockActivated(World worldIn,BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ){
if (worldIn.isRemote)
{
return true;
}
else
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityGrinder)
{
playerIn.displayGUIChest((TileEntityGrinder)tileentity);
}
return true;
}
}
Firstly The @Instance is wrong as its supposed to be @Instance(ModID) not @Instance(main)
Secondly "NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());" should not be in the FMLInitializationEvent method and should be "new GUIHandler();" instead
Thirdly "NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, this);" should be in a public constructor in the GUIHandler class.
NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, this);
}
What should be in constructor? here??
container:furnace instead of furance gui that it should be dispayed
I can see my invenory and my hotbar but not furnace gui