Jump to content

Recommended Posts

Posted

Hey there , I've got another Problem I have to bother you again with.

I've made a Custom Rendered Block with a custom Renderer and an Custom TileEntity , I've tried to store the direction into the NBT-Tags of the entity , the save and load of the direction seems to work but if The Block start to render it resets to 0 and so the Block is always facing the same direction.

 

Block

 

  Reveal hidden contents

 

 

TileEntity

 

  Reveal hidden contents

 

 

Renderer

 

  Reveal hidden contents

 

 

Thank you very much for helping me :)

Posted

The TESR is a rendering method that involves calling it every frame that is rendered. Your TE object data in not available most of the time the renderer is running because it would be ridiculously slow to try and load and save the TE data every screen frame. Can you imagine, writeToNBT and readFromNBT becing called and sent back and forth to the server every single screen refresh?????

 

Nope, not gonna happen. That is why the facing and position of a block is stored in the block -- metadata is the key. metadata is always there and accurate. NBT data for a TE is only guaranteed to be accurate when someone is using the TE.

Posted

Hey.  Know I'm replying to a solved thread, but I have a question about the solution.

 

Most of it makes sense, but I'm unclear as to what function 149730_j is checking (which is probably why my blocks are still all facing the same direction).  Also not really sure why we use the value "2" for the flag, but I'm sure that's something internal that I don't really need to know.

 

Anyway.  Some clarification on the function would be great so I can troubleshoot the mod that I'm working on :)

 

Thank you.

 

[edit]  Okay, I figured it out.  Stored the block's metadata a bit differently:

 

 

  Reveal hidden contents

 

 

Then my Render class I modified as follows:

 

 

  Reveal hidden contents

 

 

And it works like a...magical...something...that works...working...

 

Anyway.  Thanks for pointing me in the right direction :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...

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