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")) {
|
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")) {
|
||||||
|
if (!model.getGlowName().isEmpty())
|
||||||
try {
|
try {
|
||||||
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.valueOf((String) toggleValues.get("glow")));
|
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.valueOf(model.getGlowName()));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
npc.setProperty(propertyRegistry.getByName("glow", DyeColor.class), DyeColor.WHITE);
|
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() {
|
public String getSignature() {
|
||||||
return signature;
|
return signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getGlowName() {
|
||||||
|
return glowName;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue