Delete corrupt saveplayer data

This commit is contained in:
Frank Baumann 2014-02-24 15:00:50 +01:00
parent 998dbe4873
commit eccf82b733

View File

@ -60,6 +60,8 @@ public class DSavePlayer {
public void reset() {
Player onlinePlayer = p.getServer().getPlayer(this.playerName);
try{
if (onlinePlayer != null) {
/* Player is online */
onlinePlayer.getInventory().setContents(this.oldInventory);
@ -97,8 +99,13 @@ public class DSavePlayer {
offlinePlayer.saveData();
}
}
} catch (NullPointerException exception) {
P.p.log("Corrupt playerdata detected and removed!");
}
savePlayers.remove(this);
save();
}
// Static