DarkGuardsman Posted November 15, 2012 Posted November 15, 2012 I have a few mods i've been developing for keep player scores and simple data like home teleport locations. The issue i'm having is the data saved to the player is lost when the player dies. For something this is not so bad however for my kill and death counters this kills things. The only thing i can think of at the moment, which i'm trying out, is to catch the player's data before death, store, and then resave it. This most likely will work however is a bit around the issue and will break down the road. Quote http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
DarkGuardsman Posted November 17, 2012 Author Posted November 17, 2012 bump to the light. Still havn't found a way around this Quote http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
keepcalm Posted November 18, 2012 Posted November 18, 2012 Save it to the world's NBT? Quote Protip: try and find answers yourself before asking on the forum. It's pretty likely that there is an answer. Was I helpful? Give me a thank you! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
rich1051414 Posted November 18, 2012 Posted November 18, 2012 You could just keep a server side HashMap. You wouldn't really need to save it either if you do it right, do a redundancy system, where info is stored to the player and the map, and if either is null, restore with what the other has. This would allow you to get away with not actually saving the mapped data entirely. Quote
DarkGuardsman Posted November 19, 2012 Author Posted November 19, 2012 Save it to the world's NBT? i'm trying to avoid saving to a custom NBT file. Really want to see if i can just save to the player first though i'm already working on a backup plan. You could just keep a server side HashMap. You wouldn't really need to save it either if you do it right, do a redundancy system, where info is stored to the player and the map, and if either is null, restore with what the other has. This would allow you to get away with not actually saving the mapped data entirely. I have yet to use a hashMap in programming but good idea to have a way to check to make sure the data matches. I might make a system after i'm done to catch cheating/hacks to cause players stats to go up. However, i do need to save since i will be copying data between servers. Quote http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
keepcalm Posted November 20, 2012 Posted November 20, 2012 You misunderstand, I meant save it to the world itself, as part of the world's NBT .dat, not your own. Quote Protip: try and find answers yourself before asking on the forum. It's pretty likely that there is an answer. Was I helpful? Give me a thank you! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
DarkGuardsman Posted November 21, 2012 Author Posted November 21, 2012 You misunderstand, I meant save it to the world itself, as part of the world's NBT .dat, not your own. hmm that could work, while i try to figure out how to do that you have a tut i could use to help me along. Also ty. Quote http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
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.