Jump to content

[1.8][SOLVED] TileEntity is missing a mapping!


Sakuya is my waifu

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.