Jump to content

[1.15.2] Efficient methods of creating multiblocks with one large model


Recommended Posts

Posted

Hi there,

 

This may come across as a dumb question, but I'm currently creating a multiblocks that will use one large model when rendering. 

 

I know that I could have each block be a tile entity, with a special renderer that hides the block model when the multiblock is complete, and then use master and slave system to progagate interactions with the slave blocks to the master block, but that doesn't feel like the best method.

 

Something I want to avoid is having to have each block in the multiblock be its own tile entity. I currently have a master tile entity that would check on block change whether it is built and then I would like it to destroy each of the other blocks in the multiblock and then render the master itself as a large singular model. The bounding box/collision box of the multiblock to be one large connected block rather than individual blocks; which means that if a player attempted to place a block where the multiblock exists it should fail.

 

Looking into vanilla solutions I don't think there is an example of this. So I'm wondering, if anyone knows of a good way of achieving this.

No signature for you!

Posted (edited)

Yes, you certainly don't need to have every block be a tile entity. Use block states to determine whether or not the block should render by overriding getRenderType. When interacting with the block, you could have it point to some "core" block that actually has the tile entity, and make it interact from there.

The exact method for that would vary depending on your intent, and I'm sure someone could come up with a better solution, but my rough idea would be for it to have each block in the multiblock point to a neighboring block via a DirectionProperty, which would point to another block, which would eventually point to the "core" block that houses the tile entity. (You can't store block positions in block states, right? I'm not 100% sure, to be honest.)

Edited by imacatlolol

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Posted

That is an interesting solution; never thought of the direction property.

 

I think I'll try that. I can then use a block property on the core block to have it know when to switch to the different model.

 

I could also use this to change the bounding boxes for the blocks.

 

Thank you.

No signature for you!

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.