//miPlayer.saveExperience(group);
}
public void loadPlayerState(Player player, String group) {
// TODO: Check config for each save method
MIPlayer miPlayer = players.get(player.getName());
if(MIYamlFiles.controlgamemode) {
// If this is a creative world and we control the game modes let's always switch it.
if(MIYamlFiles.creativegroups.containsKey(group)) {
player.setGameMode(GameMode.CREATIVE);
// Otherwise default to the mode that they were in.
} else {
miPlayer.loadGameMode(group);
}
}
miPlayer.loadInventory(group, player.getGameMode().toString());
// Due to a dupe exploit this has to come after loading inventory
miPlayer.loadHealth(group);
miPlayer.loadHunger(group);
// If we have the xp bug, let's "set" the xp several times. Seems like the client doesn't update the
// xp properly if it's still loading the world... so let's just send it the current xp several times.
miPlayer.loadExperience(group);
if(MIYamlFiles.xpfix) {
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new SetXP(player, this), 5);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new SetXP(player, this), 15);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new SetXP(player, this), 25);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new SetXP(player, this), 35);