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

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!

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.

  • Author

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

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.