properly import skins that weren't set with a player name
This commit is contained in:
parent
580478173f
commit
31e64a15fe
2 changed files with 16 additions and 0 deletions
|
@ -27,8 +27,10 @@ import lol.pyr.znpcsplus.npc.NpcImpl;
|
|||
import lol.pyr.znpcsplus.npc.NpcTypeRegistryImpl;
|
||||
import lol.pyr.znpcsplus.packets.PacketFactory;
|
||||
import lol.pyr.znpcsplus.scheduling.TaskScheduler;
|
||||
import lol.pyr.znpcsplus.skin.Skin;
|
||||
import lol.pyr.znpcsplus.skin.cache.MojangSkinCache;
|
||||
import lol.pyr.znpcsplus.skin.descriptor.FetchingDescriptor;
|
||||
import lol.pyr.znpcsplus.skin.descriptor.PrefetchedDescriptor;
|
||||
import lol.pyr.znpcsplus.util.BungeeConnector;
|
||||
import lol.pyr.znpcsplus.util.ItemSerializationUtil;
|
||||
import lol.pyr.znpcsplus.util.NpcLocation;
|
||||
|
@ -123,6 +125,9 @@ public class ZNpcImporter implements DataImporter {
|
|||
if (model.getSkinName() != null) {
|
||||
npc.setProperty(propertyRegistry.getByName("skin", SkinDescriptor.class), new FetchingDescriptor(skinCache, model.getSkinName()));
|
||||
}
|
||||
else if (model.getSkin() != null && model.getSignature() != null) {
|
||||
npc.setProperty(propertyRegistry.getByName("skin", SkinDescriptor.class), new PrefetchedDescriptor(new Skin(model.getSkin(), model.getSignature())));
|
||||
}
|
||||
|
||||
NpcEntryImpl entry = new NpcEntryImpl(String.valueOf(model.getId()), npc);
|
||||
entry.enableEverything();
|
||||
|
|
|
@ -10,6 +10,9 @@ public class ZNpcsModel {
|
|||
private UUID uuid;
|
||||
private double hologramHeight;
|
||||
private String skinName;
|
||||
private String skin;
|
||||
private String signature;
|
||||
|
||||
private String glowName;
|
||||
private ZNpcsLocation location;
|
||||
private String npcType;
|
||||
|
@ -57,4 +60,12 @@ public class ZNpcsModel {
|
|||
public Map<String, String[]> getCustomizationMap() {
|
||||
return customizationMap;
|
||||
}
|
||||
|
||||
public String getSkin() {
|
||||
return skin;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue