Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted
  On 2/23/2013 at 4:14 PM, endershadow said:

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.