Admin reset commands have been fixed.

Resetting skills no longer resets attributes and vice versa.
This commit is contained in:
Aria Sangarin 2020-03-05 21:42:25 +01:00
parent f314627f21
commit 2677882d0b

View File

@ -116,11 +116,11 @@ public class ResetCommandMap extends CommandEnd {
}
PlayerData data = PlayerData.get(player);
data.setAttributePoints(0);
data.setAttributeReallocationPoints(0);
for(PlayerAttribute att : MMOCore.plugin.attributeManager.getAll())
data.setAttribute(att, 0);
sender.sendMessage(ChatColor.GOLD + player.getName() + ChatColor.YELLOW + "'s attribute data was succesfully reset.");
data.setSkillPoints(0);
MMOCore.plugin.skillManager.getAll().forEach(skill -> data.lockSkill(skill));
while (data.hasSkillBound(0))
data.unbindSkill(0);
sender.sendMessage(ChatColor.GOLD + player.getName() + ChatColor.YELLOW + "'s skill data was succesfully reset.");
return CommandResult.SUCCESS;
}
}
@ -144,11 +144,11 @@ public class ResetCommandMap extends CommandEnd {
}
PlayerData data = PlayerData.get(player);
data.setSkillPoints(0);
MMOCore.plugin.skillManager.getAll().forEach(skill -> data.lockSkill(skill));
while (data.hasSkillBound(0))
data.unbindSkill(0);
sender.sendMessage(ChatColor.GOLD + player.getName() + ChatColor.YELLOW + "'s skill data was succesfully reset.");
data.setAttributePoints(0);
data.setAttributeReallocationPoints(0);
for(PlayerAttribute att : MMOCore.plugin.attributeManager.getAll())
data.setAttribute(att, 0);
sender.sendMessage(ChatColor.GOLD + player.getName() + ChatColor.YELLOW + "'s attribute data was succesfully reset.");
return CommandResult.SUCCESS;
}
}