Add Forgotten Changes

• Just added some small things that were forgotten in the last commit
This commit is contained in:
StrangeOne101 2016-03-16 16:15:02 +13:00
parent eedc65cc21
commit 0e99fbef4d
2 changed files with 9 additions and 0 deletions

View file

@ -98,6 +98,13 @@ public class AddCommand extends PKCommand {
return;
}
bPlayer.addElement(e);
for (SubElement sub : Element.getAllSubElements()) {
if (sub.getParentElement() == e && bPlayer.hasSubElementPermission(sub)) {
bPlayer.addSubElement(sub);
}
}
ChatColor color = e.getColor();
if (!(sender instanceof Player) || !((Player) sender).equals(target)) {
@ -106,6 +113,7 @@ public class AddCommand extends PKCommand {
target.sendMessage(color + added.replace("{element}", e.getName() + e.getType().getBender()));
}
GeneralMethods.saveElements(bPlayer);
GeneralMethods.saveSubElements(bPlayer);
Bukkit.getServer().getPluginManager().callEvent(new PlayerChangeElementEvent(sender, target, e, Result.ADD));
return;
} else if (Arrays.asList(Element.getAllSubElements()).contains(e)) {

View file

@ -138,6 +138,7 @@ public class ChooseCommand extends PKCommand {
target.sendMessage(color + chosen.replace("{element}", element.getName() + element.getType().getBender()));
}
GeneralMethods.saveElements(bPlayer);
GeneralMethods.saveSubElements(bPlayer);
Bukkit.getServer().getPluginManager().callEvent(new PlayerChangeElementEvent(sender, target, element, Result.CHOOSE));
}