Jump to content

Recommended Posts

Posted

I was working on my mod, getting it from 1.6 to 1.7. I solved all the errors, but it still does not work

It has an gui on it, but right clicking does nog work. I have a custom renderer on it, but it does not work.

 

This is the code from the Block:

 

  Reveal hidden contents

 

 

Here is the code for tthe renderer.

Trust me, it is initialized in the main class, the clientproxy class, the guihandler class.

This is bassicly a rendere with only items attached to it. (entityItems)

 

  Reveal hidden contents

 

 

I hope you can give me more info on the problem.

If these file are not the one you want, I can post others too.

 

thanks in advance

Coding, Testing, Smiling, Publishing!

Posted
  On 5/1/2014 at 8:50 AM, sequituri said:

As far as opening a GUI, the server side has to tell the client side to open the GUI while the server uses the Container. Packets... use them.

 

Yes, I did that, but it still does not work.

Look, this is the guihandler I use.

 

public class GuiHandler implements IGuiHandler {

@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { 
	switch(id){
	case 0:
		return new ContainerShield(player.inventory, (TileEntityShield) world.getTileEntity(x, y, z));

	}

	return null;
}

@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
	switch(id){
	case 0:
		return new GuiShield(player.inventory, (TileEntityShield) world.getTileEntity(x, y, z));

	}

	return null;

}
}

Coding, Testing, Smiling, Publishing!

Posted

Use this:

 

@Override
public TileEntity createNewTileEntity(World var1, int metadata)
{
return new TileEntityShield();
}

 

Your other TileEntity method isn't getting called because it was removed for a meta-sensitive version. Also, please, please, PLEASE use @Override notations in your code...it'll save so much headache both for us and you. You can automagically tell which method is not getting called by using that notation.

 

*sigh*

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.