Jump to content

Recommended Posts

Posted

In my mod, I've noticed a problem where I am trying to update information in a TileEntity that has been unloaded. There isn't really a way to get around this except loading the chunk the block is in, just long enough to update the data I need.

 

However, I have no idea how to load/unload a chunk, because I am a total n00b. Any help is appreciated.

 

My code: https://gist.github.com/anonymous/7295390

Posted

From what little i have experimented with this i found out

 

Chunk c = worldObj.getChunkFromBlockCoords(xCoord, zCoord);

worldObj.getChunkProvider().loadChunk(c.xPosition, c.zPosition);

 

Loads it some what well but i have no idea how often to call it to make it efficient and anything like that.

Posted

That doesn't appear to be helping any. Somehow my getBlockTileEntity call is returning null, so either it's a problem with that, or that code just isn't loading the chunk. I've tried changing worldObj to world (since I pass the world in my function call) and that sill didn't work. I'm at a loss.

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.