Posted February 20, 201312 yr Ok, I have part of a mod that uses a tweaked furnace for something.. The section of code throwing my only error at this time is below <iframe src="http://paste.minecraftforge.net/view/embed/312d2972" style="border:none;width:100%"></iframe> <Edit> - Pfft so much for the embed working /** * Called upon block activation (right click on the block.) */ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } else { TileEntityResearchBlock var10 = (TileEntityResearchBlock)par1World.getBlockTileEntity(par2, par3, par4); if (var10 != null) { par5EntityPlayer.displayGUIResearchBlock(var10); } return true; } } The Error is:- The method displayGUIResearchBlock(TileEntityResearchBlock) is undefined for the type EntityPlayer Now, I understand that this is saying the GUIResearchBlock is not defined in the EntityPlayer file, but I don't want to directly change this base file. Can anyone explain, or point me to something that will tell me how to get this working please.. I've searched many GUI tutorials with no luck. Thanks in advance, pmardle
February 20, 201312 yr You need to have a class that implements IGuiHandler, look it up to understand how to use it. Essentially you have a IGuiHandler that takes a ID specific for the GUI you want to open, and returns the GUI object on the client, and the container object on the server. You register this handler with your NetworkRegistry, and then you can open the GUI from your block by calling par5EntityPlayer.openGui(MyMod.instance, 0/*this is the gui-specific ID, pick whatever you want*/, par1World, par2, par3, par4);
February 21, 201312 yr Author Thanks, Used the line you suggested and tweaked a few other bits and bobs, and it all works squiffily well now thanks
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.