mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Simplify skin.applyAndRespawn slightly
This commit is contained in:
parent
bbd45127b2
commit
f0105a578f
@ -85,18 +85,13 @@ public class Skin {
|
|||||||
if (skinName.equals(cachedName) && texture != null && !texture.equals("cache")) {
|
if (skinName.equals(cachedName) && texture != null && !texture.equals("cache")) {
|
||||||
setNPCTexture(entity, new SkinProperty("textures", texture, skinTrait.getSignature()));
|
setNPCTexture(entity, new SkinProperty("textures", texture, skinTrait.getSignature()));
|
||||||
|
|
||||||
// check if NPC prefers to use cached skin over the latest skin.
|
|
||||||
if (entity.getNPC().data().has("player-skin-use-latest")) {
|
|
||||||
entity.getNPC().data().remove("player-skin-use-latest");
|
|
||||||
}
|
|
||||||
if (!skinTrait.shouldUpdateSkins()) // cache preferred
|
if (!skinTrait.shouldUpdateSkins()) // cache preferred
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!hasSkinData()) {
|
if (!hasSkinData()) {
|
||||||
String defaultSkinName = ChatColor.stripColor(npc.getName()).toLowerCase(Locale.ROOT);
|
String npcName = ChatColor.stripColor(npc.getName()).toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
if (npc.hasTrait(SkinTrait.class) && skinName.equals(defaultSkinName)
|
if (!skinTrait.shouldUpdateSkins() && !skinTrait.fetchDefaultSkin() && skinName.equals(npcName))
|
||||||
&& !npc.getOrAddTrait(SkinTrait.class).fetchDefaultSkin())
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (hasFetched)
|
if (hasFetched)
|
||||||
|
Loading…
Reference in New Issue
Block a user