Jump to content

[1.6.4+] Chunk loading & Multiblock, Generic question


TNTworks

Recommended Posts

Hello, I would like to ask a question about how chunk loading is affected by multiblock structures, lets imagine I'm coding a multiblock long 32 blocks x 3 x 3, this structure can intersect 2 or 3 chunks, what if i have 2 TileEntities on both sides, which are 32 blocks away from each other, they are communicating with each other

 

Imagine 1st part want to insert/take item from the other part which is in 2nd/3rd chunk away, which is not loaded by player, what will happen?, will the game load that chunk?, or will it throw some error/null?

 

That's a theoretical question, I'm actually coding an multistructural machine, which is supposed to have 2 TileEntities, they are going to take/insert items from each other, and so one...

 

Thanks

 

EDIT: Version im going to code in is 1.6.4, but i think that should not matter that much.

Link to comment
Share on other sites

Whataver, i guess it does load the chunk if u are using this function, the function is from vanilla minecraft

TileEntity tileentity = par0World.getBlockTileEntity(i, j, k);

 

which i traced back and it goes like this

 

TileEntity tileentity = par0World.getBlockTileEntity(i, j, k);

--> Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4);

----> return this.chunkProvider.provideChunk(par1, par2);

------> return chunk == null ? /*other stuff*/ this.loadChunk(par1, par2)) : chunk;

--------> chunk = this.safeLoadChunk(par1, par2);

----------> Chunk chunk = this.currentChunkLoader.loadChunk(this.worldObj, par1, par2);

------------> return this.checkedReadChunkFromNBT(par1World, par2, par3, nbttagcompound);

 

which of course will load even the uploaded chunks :), i hope i helped someone who will ask this question again

Link to comment
Share on other sites

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.