Posted November 15, 201212 yr 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. http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
November 17, 201212 yr Author bump to the light. Still havn't found a way around this http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
November 18, 201212 yr Save it to the world's NBT? 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!)
November 18, 201212 yr 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.
November 19, 201212 yr Author 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. http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
November 20, 201212 yr You misunderstand, I meant save it to the world itself, as part of the world's NBT .dat, not your own. 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!)
November 21, 201212 yr Author 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. http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
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.