From 0e99fbef4d6012ec80a20aea4b4311267004b367 Mon Sep 17 00:00:00 2001 From: StrangeOne101 Date: Wed, 16 Mar 2016 16:15:02 +1300 Subject: [PATCH] Add Forgotten Changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Just added some small things that were forgotten in the last commit --- src/com/projectkorra/projectkorra/command/AddCommand.java | 8 ++++++++ .../projectkorra/projectkorra/command/ChooseCommand.java | 1 + 2 files changed, 9 insertions(+) diff --git a/src/com/projectkorra/projectkorra/command/AddCommand.java b/src/com/projectkorra/projectkorra/command/AddCommand.java index 79f9575f..951cb1b6 100644 --- a/src/com/projectkorra/projectkorra/command/AddCommand.java +++ b/src/com/projectkorra/projectkorra/command/AddCommand.java @@ -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)) { diff --git a/src/com/projectkorra/projectkorra/command/ChooseCommand.java b/src/com/projectkorra/projectkorra/command/ChooseCommand.java index 34d43648..3b4c8599 100644 --- a/src/com/projectkorra/projectkorra/command/ChooseCommand.java +++ b/src/com/projectkorra/projectkorra/command/ChooseCommand.java @@ -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)); }