Abstract our database operations into a single class.

This allows the logic between SQL and Flatfile to remain more hidden in
most cases and makes the code easier to read.
This commit is contained in:
GJ
2013-04-18 17:37:36 -04:00
parent 1aff2cf9eb
commit eea5784527
18 changed files with 1181 additions and 1376 deletions

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.runnables.player;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
@ -19,8 +20,10 @@ public class PlayerProfileSaveTask extends BukkitRunnable {
public void run() {
playerProfile.save();
if (!mcMMOPlayer.getPlayer().isOnline()) {
UserManager.remove(playerProfile.getPlayerName());
Player player = mcMMOPlayer.getPlayer();
if (!player.isOnline()) {
UserManager.remove(player.getName());
}
}
}