aboutsummaryrefslogtreecommitdiff
path: root/features/cosmetics
diff options
context:
space:
mode:
Diffstat (limited to 'features/cosmetics')
-rw-r--r--features/cosmetics/cosmetic/dragon/dragonWings.js7
-rw-r--r--features/cosmetics/index.js22
2 files changed, 12 insertions, 17 deletions
diff --git a/features/cosmetics/cosmetic/dragon/dragonWings.js b/features/cosmetics/cosmetic/dragon/dragonWings.js
index 8638b93..a5b76d8 100644
--- a/features/cosmetics/cosmetic/dragon/dragonWings.js
+++ b/features/cosmetics/cosmetic/dragon/dragonWings.js
@@ -291,12 +291,17 @@ class DragonWings extends Cosmetic {
if(wingCosmetic !== null){
this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{
b.isHidden = true
+ this.parent.hiddenCosmetics.push(b)
})
}else{
let fullBodyCosmetic = this.player.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.FULL_BODY)
if(fullBodyCosmetic === "DRAGON_ONESIE_2"){
this.player.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{
- if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1")b.isHidden = true
+ if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1"){
+ b.isHidden = true
+
+ this.parent.hiddenCosmetics.push(b)
+ }
})
}
}
diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js
index d519351..4fb1242 100644
--- a/features/cosmetics/index.js
+++ b/features/cosmetics/index.js
@@ -17,6 +17,8 @@ class Cosmetics extends Feature {
this.uuidToCosmetic = {}
this.cosmeticsData = {}
+
+ this.hiddenCosmetics = []
this.playerHasACosmeticA = false
@@ -157,23 +159,10 @@ class Cosmetics extends Feature {
}
restoreEssentialCosmetics(){
- World.getAllPlayers().forEach(p=>{
- if(!p.getPlayer().getEssentialCosmetics()) return
-
- let wingCosmetic = p.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.WINGS)
- if(wingCosmetic !== null){
- p.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(wingCosmetic)).getModel().getModel().boneList.forEach(b=>{
- b.isHidden = false
- })
- }else{
- let fullBodyCosmetic = p.getPlayer().getEssentialCosmetics().get(EssentialCosmeticSlot.FULL_BODY)
- if(fullBodyCosmetic === "DRAGON_ONESIE_2"){
- p.getPlayer().getEssentialCosmeticModels().get(Essential.instance.getConnectionManager().getCosmeticsManager().getCosmetic(fullBodyCosmetic)).getModel().getModel().boneList.forEach(b=>{
- if(b.boxName === "wing_left_1" || b.boxName === "wing_right_1")b.isHidden = false
- })
- }
- }
+ this.hiddenCosmetics.forEach(cosmetic=>{
+ cosmetic.isHidden = false
})
+ this.hiddenCosmetics = []
}
renderWorld(ticks){
@@ -187,6 +176,7 @@ class Cosmetics extends Feature {
this.uuidToCosmetic = undefined
this.playerHasACosmeticA = undefined
this.cosmeticsData = undefined
+ this.hiddenCosmetics = undefined
}
onDisable(){