Posted February 23, 201312 yr Hey Guys, Sorry to have to post, I'm not usually one to do so, but I'm really stuck. After setting up my furnace, right clicking on it in-game does nothing, if someone would be kind enough to take a look at my code to see if anything is amiss that would we great. Here's a .zip to download if you want it https://dl.dropbox.com/u/31947512/sourcecode.zip Virus Total - https://www.virustotal.com/en/file/69a28fd31a38d8bf029b4973766208e74a8a5c6753b753a5420718fcf10e0f52/analysis/1361628225/ And here's a folder in my SkyDrive account if you would rather use it. http://sdrv.ms/ZpLD6y This line in BlockMyFurnace DOES print to the console on right click System.out.println("Trying to open GUI..."); Please note that I have renamed my mod and furnace to protect it's identity. Thanks a lot for any responses, JPiiONEFOURONE EDIT: This mod is NOT a server mod. I have added Network annotations purely to try fixing this problem.
February 23, 201312 yr try doing this for your onActivated method in the block class @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { return false; } player.openGui(MyMod.instance, 0, world, x, y, z); return true; } } and make sure the two methods in the GUI handler have the EXACT same code in each of them, or the inventory will be buggy when it's opened
February 23, 201312 yr Author You sir, are a genius. Your help is greatly appreciated. Thanks a lot, JPiiONEFOURONE
February 23, 201312 yr Author try doing this for your onActivated method in the block class @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { return false; } player.openGui(MyMod.instance, 0, world, x, y, z); return true; } } and make sure the two methods in the GUI handler have the EXACT same code in each of them, or the inventory will be buggy when it's opened One more problem you might be able to help me with. If I make the code in the server element the same as in the client element like you said, it crashes the game when I open the gui, and if I don't put it the same, the gui is buggy also like you said. Any pointers? I can post the errors if you want. Thanks, JPiiONEFOURONE
February 25, 201312 yr put it like he said but make sure that you are handling the opening on client side only by checking if world.isremote) if you want some pointers, here you go: 0x3A29314D 0x249A431A hm? http://devhumor.com/wp-content/uploads/2012/04/devhumor.com_pointers.png If you guys dont get it.. then well ya.. try harder...
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.