fix: glow import for znpcs
This commit is contained in:
parent
b8dda22154
commit
218c4e48cc
2 changed files with 12 additions and 5 deletions
|
@ -189,12 +189,15 @@ public class ZNpcImporter implements DataImporter {
|
|||
if (toggleValues.containsKey("mirror")) {
|
||||
npc.setProperty(propertyRegistry.getByName("skin", SkinDescriptor.class), new MirrorDescriptor(skinCache));
|
||||
}
|
||||
if (toggleValues.containsKey("glow")) {
|
||||
try {
|
||||
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.valueOf((String) toggleValues.get("glow")));
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (toggleValues.containsKey("glow") && (boolean) toggleValues.get("glow")) {
|
||||
if (!model.getGlowName().isEmpty())
|
||||
try {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,4 +84,8 @@ public class ZNpcsModel {
|
|||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public String getGlowName() {
|
||||
return glowName;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue