megabitus Posted August 22, 2014 Posted August 22, 2014 Hi! As the title says is there a way to save data between saves? Quote Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution
Black Posted August 22, 2014 Posted August 22, 2014 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. Quote
Tslat Posted August 22, 2014 Posted August 22, 2014 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 Quote
megabitus Posted August 22, 2014 Author Posted August 22, 2014 Thanks for the fast answers. I have a chest that it will synchronize the items between worlds. Quote Woking at my first mod, Blocks & Items Revolution : https://github.com/megabitus98/Blocks-Items-Revolution
Ewe Loon Posted August 22, 2014 Posted August 22, 2014 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 Quote
Recommended Posts
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.