From bf8945b3985e98f117b17a314bbb5dada04ab4d6 Mon Sep 17 00:00:00 2001 From: TheMolkaPL Date: Wed, 13 Nov 2019 17:05:56 +0100 Subject: [PATCH] Alias effect to potion in XML Signed-off-by: TheMolkaPL --- src/main/java/tc/oc/pgm/kits/KitParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/tc/oc/pgm/kits/KitParser.java b/src/main/java/tc/oc/pgm/kits/KitParser.java index a08d1a8bae..9a2aa422f8 100644 --- a/src/main/java/tc/oc/pgm/kits/KitParser.java +++ b/src/main/java/tc/oc/pgm/kits/KitParser.java @@ -267,15 +267,15 @@ public PotionKit parsePotionKit(Element el) throws InvalidXMLException { public List parsePotions(Element el) throws InvalidXMLException { List effects = new ArrayList<>(); - Node attr = Node.fromAttr(el, "potion", "potions"); + Node attr = Node.fromAttr(el, "potion", "potions", "effect", "effects"); if (attr != null) { for (String piece : attr.getValue().split(";")) { effects.add(XMLUtils.parseCompactPotionEffect(attr, piece)); } } - for (Element elPotion : el.getChildren("potion")) { - effects.add(XMLUtils.parsePotionEffect(elPotion)); + for (Node elPotion : Node.fromChildren(el, "potion", "effect")) { + effects.add(XMLUtils.parsePotionEffect(elPotion.getElement())); } return effects;