Skip to content

Commit

Permalink
fix entity potion effects output and patch effect parsing to accept o…
Browse files Browse the repository at this point in the history
…ld input
  • Loading branch information
mcmonkey4eva committed May 31, 2020
1 parent 9d2ad7f commit 2ea973f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -68,9 +68,9 @@ public String getPropertyString() {
}
ListTag returnable = new ListTag();
for (PotionEffect effect : effects) {
returnable.add(effect.getType().getName() + "," + effect.getAmplifier() + "," + effect.getDuration());
returnable.add(ItemPotion.stringifyEffect(effect));
}
return returnable.identify().substring(3);
return returnable.identify();
}

public String getPropertyId() {
Expand Down
Expand Up @@ -74,8 +74,12 @@ public static PotionEffect parseEffect(String str) {
// as compared to the PotionEffect constructor!
int duration = new ElementTag(d2[2]).asInt();
int amplifier = new ElementTag(d2[1]).asInt();
boolean ambient = new ElementTag(d2[3]).asBoolean();
boolean particles = new ElementTag(d2[4]).asBoolean();
boolean ambient = true;
boolean particles = true;
if (d2.length > 3) {
ambient = new ElementTag(d2[3]).asBoolean();
particles = new ElementTag(d2[4]).asBoolean();
}
Color color = null;
boolean icon = false;
if (d2.length > 5) {
Expand Down

0 comments on commit 2ea973f

Please sign in to comment.