upstream #1

Closed
bridge wants to merge 65 commits from feat/upstream into 2.X
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 218c4e48cc - Show all commits

View file

@ -189,12 +189,15 @@ public class ZNpcImporter implements DataImporter {
if (toggleValues.containsKey("mirror")) { if (toggleValues.containsKey("mirror")) {
npc.setProperty(propertyRegistry.getByName("skin", SkinDescriptor.class), new MirrorDescriptor(skinCache)); npc.setProperty(propertyRegistry.getByName("skin", SkinDescriptor.class), new MirrorDescriptor(skinCache));
} }
if (toggleValues.containsKey("glow")) { if (toggleValues.containsKey("glow") && (boolean) toggleValues.get("glow")) {
try { if (!model.getGlowName().isEmpty())
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.valueOf((String) toggleValues.get("glow"))); try {
} catch (IllegalArgumentException e) { npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.valueOf(model.getGlowName()));
} catch (IllegalArgumentException e) {
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.WHITE);
}
else
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.WHITE); npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.WHITE);
}
} }
} }

View file

@ -84,4 +84,8 @@ public class ZNpcsModel {
public String getSignature() { public String getSignature() {
return signature; return signature;
} }
public String getGlowName() {
return glowName;
}
} }