Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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."

GameRegistry.registerTileEntity(MyTileEntity.class, 15);

 

You could maybe try this

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

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

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

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.

  • Author

i didn't use his code, just to be bit more organized i created new class where i register all of my tileentities... and it works fine

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.