Jump to content

Recommended Posts

Posted

Hello everyone. I have a customly rendered table, and I am trying to figure out how to connect two tables if they are placed next to each other, similar to a fence or iron bar. I haven't seen much on how to do this, but I think I have it half done. The table that I place down next to it will update it's model accordingly, but the other one that is already there won't.

 

Here are some screenshots of the situation:

 

Tables when not connected:

 

  Reveal hidden contents

 

 

Tables when connected:

 

  Reveal hidden contents

 

 

As you can see, the other two adjacent tables are not updating their model, even though they should be.

 

So I guess I have two questions:

1. How can I change a currently existing block's model?

2. If I'm doing this the complete wrong way, what is the best way of doing it?

 

Here is some of the code that I currently have:

 

BlockTable:

 

  Reveal hidden contents

 

 

ModelTable:

 

  Reveal hidden contents

 

 

TileEntityTable:

 

  Reveal hidden contents

 

 

TileEntityTableRenderer:

 

  Reveal hidden contents

 

 

Thanks in advance for any help.

Posted

Hi

 

Personally, I would do this completely without TileEntities, just using Blocks and Metadata.  There are quite a few vanilla examples of this (fence, for example, like you said, or panes).  Whenever a block is placed or destroyed, it  makes a call to all its neighbors (I forget which method but it's easy to spot) so that they can update their metadata and change their displayed texture.

 

You can do the same thing with TileEntities too (just trigger the model change from the block update-my-neighbor method), but I suspect you don't need them.

 

-TGG

 

PS your method UpdateModel should be updateModel, otherwise it looks like a constructor.

 

 

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.