Jump to content

Recommended Posts

Posted

so that's the error i'm getting every time i try to place my tile entity block in the world. i know it needs to be registered... but how

you cant just put "GameRegistry.registerTileEntity..." ¯\_(ツ)_/¯

can anyone tell me how?

~thanks

"The cycle of life and death continues. We will live, they will die."

Posted

It was just a rondom number, to show you you can register from 0 - nearly infinite. Just wanted to help Sir Perfect

Creator of Extra Shoes

 

Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then

Posted

You can keep it, but its not necessary, just have a method in your clientproxy in which you register all your tileentities. If you wanna make it a bit more easy and don't wanna have all that GameRegistry.registerTileEntity stuff for each of your tiles-use this generic method:

 

private void setupTile(Class<? extends TileEntity> class1, TileEntitySpecialRenderer render) {
	try {
		ClientRegistry.bindTileEntitySpecialRenderer(class1, render.getClass().newInstance());
	} catch (Exception e) {
		e.printStackTrace();
		}
		GameRegistry.registerTileEntity(class1, class1.getName());
}

It takes in the TileEntity and the relatet renderer

Posted

You can keep it, but its not necessary, just have a method in your clientproxy in which you register all your tileentities. If you wanna make it a bit more easy and don't wanna have all that GameRegistry.registerTileEntity stuff for each of your tiles-use this generic method:

 

private void setupTile(Class<? extends TileEntity> class1, TileEntitySpecialRenderer render) {
	try {
		ClientRegistry.bindTileEntitySpecialRenderer(class1, render.getClass().newInstance());
	} catch (Exception e) {
		e.printStackTrace();
		}
		GameRegistry.registerTileEntity(class1, class1.getName());
}

It takes in the TileEntity and the relatet renderer

No, don't do that - render classes can only be registered on the CLIENT, whereas TileEntities themselves need to be registered on both sides (i.e. 'common' code).

 

You are just asking to crash your mod when you play it multiplayer by writing code like that - rendering registrations should all be in the ClientProxy.

 

EDIT: I reread your post and see that snippet IS in your ClientProxy, in which case are you also registering the TileEntities on the server? Because the server will need to know about them, too, and it won't if they only get registered in the ClientProxy.

Posted

You can keep it, but its not necessary, just have a method in your clientproxy in which you register all your tileentities. If you wanna make it a bit more easy and don't wanna have all that GameRegistry.registerTileEntity stuff for each of your tiles-use this generic method:

 

private void setupTile(Class<? extends TileEntity> class1, TileEntitySpecialRenderer render) {
	try {
		ClientRegistry.bindTileEntitySpecialRenderer(class1, render.getClass().newInstance());
	} catch (Exception e) {
		e.printStackTrace();
		}
		GameRegistry.registerTileEntity(class1, class1.getName());
}

It takes in the TileEntity and the relatet renderer

No, don't do that - render classes can only be registered on the CLIENT, whereas TileEntities themselves need to be registered on both sides (i.e. 'common' code).

 

You are just asking to crash your mod when you play it multiplayer by writing code like that - rendering registrations should all be in the ClientProxy.

 

EDIT: I reread your post and see that snippet IS in your ClientProxy, in which case are you also registering the TileEntities on the server? Because the server will need to know about them, too, and it won't if they only get registered in the ClientProxy.

 

No actually they don't - thanks for that :D

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.