Posted September 30, 201510 yr Hi, could you explain me how Chunk is loaded ? For my mod, I save all removed block from an explosion to restore it later. I currently work on serialization to save unrestored blocks when server shutdown. My first idea was storing in world.perWorldMapStorage a Map<Chunk, File> for "affected chunk ==> file where is stored explosion data" (1 file = 1 explosion, because I can have dependencies from other chunk to replace block in a good order) and create a file when an explosion occurs then store in json format data I need then save the file in "world directory/myMod/custom_name_timestamp.json". Create an engine to load and unload explosion data when chunk is loaded/unloaded. But it doesn't seen to be the best practice. Next I thought about creating an Entity which could contains my explosion data. So loading and unloading will be implemented by Minecraft code. Something less to do and maintains However to do that I need to know how chunk loading/unloading works. Let me explain with an example : I have a big explosion of 10 chunks. My entity is located in the middle of the explosion area. When entity is loaded block are progressively restored. But if entity is located in chunk loaded border, I have 5 chunk loaded and 5 chunk unloaded. When I want to restore a block located in a unloaded chunk, is this chunk loaded then immediately unloaded ? So if my next restoring is a block in this chunk, it will be loaded and unloaded again ?
September 30, 201510 yr As far as I know, and i might be wrong, setting blocks in an unloaded chunk loads the chunk and unloads the chunk after its done
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.