Jump to content

ClientRegistry.bindTileEntity question


poboy975

Recommended Posts

Hello, I'm working on learning to mod. I do know a bit of java and c#. I'm looking for help updating the bond tile entity. The top section was me trying to update the bottom line. The bottom line works in 1.15. I've not found the right information yet to help me understand the changes in versions. Can anyone help? Thank you.

 

Attempt to update:

ClientRegistry.bindTileEntityRenderer((TileEntity<ModTypeTile>) ObjHandler.MOD_TYPE_TILE = RegistryEvent.Register("ModTypeTile", () -> TileEntityType.Builder(new ModTypeRenderer(new ResourceLocation(Mod.MODID, "textures/blocks/mod_item.png", ));

 

Original Code 1.15:

ClientRegistry.bindTileEntityRenderer((TileEntity<ModTypeTile>) ObjHandler.MOD_TYPE_TILE, dispatcher -> new ModTypeRenderer(dispatcher, new ResourceLocation(Mod.MODID, "textures/blocks/mod_item.png"), block -> block == ObjHandler.modtype));

Link to comment
Share on other sites

RegistryEvent.Register("ModTypeTile", () -> TileEntityType.Builder(new ModTypeRenderer(new ResourceLocation(Mod.MODID, "textures/blocks/mod_item.png", )); 

This is not how you register a tile entity type, and the bindTileEntityRenderer method is not the place where you would want to register a registry object. I suggest taking a look at the docs regarding tile entity creation: https://mcforge.readthedocs.io/en/latest/tileentities/tileentity/

Also use your IDE to see what the bindTileEntityRenderer method accepts in its parameters, currently you are not telling it which is the tile entity renderer you want to bind to your tile entity

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

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.