Skip to content

Commit

Permalink
fix potion color handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 10, 2018
1 parent 7586a8b commit 96253ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -63,7 +63,7 @@ public static dColor valueOf(String string, TagContext context) {
dB.echoError("Security exception getting color field!");
}
catch (NoSuchFieldException e1) {
dB.echoError("No such color field!");
dB.echoError("No such color field '" + string + "'!");
}

if (colorField != null) {
Expand Down
Expand Up @@ -62,7 +62,7 @@ public String getPropertyString() {
effects.add(meta.getBasePotionData().getType()
+ "," + meta.getBasePotionData().isUpgraded()
+ "," + meta.getBasePotionData().isExtended()
+ (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_12_R1) && meta.hasColor() ? "," + new dColor(meta.getColor()).identify() : "")
+ (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_12_R1) && meta.hasColor() ? "," + new dColor(meta.getColor()).identify().replace(",", "&comma") : "")
);
for (PotionEffect pot : meta.getCustomEffects()) {
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -329,7 +329,7 @@ public void adjust(Mechanism mechanism) {
CoreUtilities.toLowerCase(d1[1]).equals("true")));
if (d1.length > 3) {
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_11_R1)) {
meta.setColor(dColor.valueOf(d1[3]).getColor());
meta.setColor(dColor.valueOf(d1[3].replace("&comma", ",")).getColor());
}
else {
dB.echoError("Potion effect color is not supported before Minecraft version 1.11.");
Expand Down

0 comments on commit 96253ff

Please sign in to comment.