Posted August 22, 201411 yr Hi! As the title says is there a way to save data between saves? Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution
August 22, 201411 yr Well, the first solution that comes to mind would be to save that data to an external save, e.g. a textfile or bytefile just like you would do in a normal application and save it to the minecraft folder(much like a config file). Then when you need to load the object that needs the data just read the data you loaded back into the game on startup(to save on waiting time). That seems to be the most sensible. Otherwise going through the level.dat is complete and utter waste of computing time. The only downside(or plusside) is that if you delete a world it won't delete the folder unless you specifically modify what it has to delete, which I'll guess without looking at the code would be quite a challenge. And if there are build-in ways, which I do not know since I've never had to do such a thing, use those. Although to be honest I don't think there is, the only mod I can remember that does that is the one that has portals going from one world to another.
August 22, 201411 yr Why would you want to save in between default saves, and what exactly are you saving? Perhaps you should look at net.minecraft.world.storage.ISaveHandler
August 22, 201411 yr Author Thanks for the fast answers. I have a chest that it will synchronize the items between worlds. Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution
August 22, 201411 yr you need to be careful saving items and blocks , if you use writenbttag methods they save the internal id of the items and blocks, this could cause problems when loading into a different game, as the ids could be different you will need to write your own saving method, and use the Item's name
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.