aboutsummaryrefslogtreecommitdiff
path: root/features/cosmetics
diff options
context:
space:
mode:
Diffstat (limited to 'features/cosmetics')
-rw-r--r--features/cosmetics/hiddenRequirement.js7
-rw-r--r--features/cosmetics/index.js5
2 files changed, 8 insertions, 4 deletions
diff --git a/features/cosmetics/hiddenRequirement.js b/features/cosmetics/hiddenRequirement.js
index 7e0b57a..dbc3e06 100644
--- a/features/cosmetics/hiddenRequirement.js
+++ b/features/cosmetics/hiddenRequirement.js
@@ -1,5 +1,4 @@
-let cosmeticsClass = require("./index").class
-export default ()=>{
- return !!cosmeticsClass?.cosmeticsData?.[Player.getUUID().toString()]
-} \ No newline at end of file
+module.exports = {hidden: function(featureManager){
+ return !(featureManager.features.cosmetics?.["class"]?.playerHasACosmeticA || false)
+}} \ No newline at end of file
diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js
index 593ac7c..11d9f47 100644
--- a/features/cosmetics/index.js
+++ b/features/cosmetics/index.js
@@ -16,6 +16,8 @@ class Cosmetics extends Feature {
this.cosmeticsData = {}
+ this.playerHasACosmeticA = false
+
this.firstPersonVisable = new Toggle("Cosmetics visable in first person", "", false, "cosmetics_first_person_visable", this)
this.lessFirstPersonVisable = new Toggle("Make cosmetics less visable in first person mode", "", true, "cosmetics_first_person_less_visable", this).requires(this.firstPersonVisable)
@@ -38,6 +40,7 @@ class Cosmetics extends Feature {
let data = JSON.parse(FileLib.getUrlContent("http://soopymc.my.to/api/soopyv2/cosmetics.json"))
this.cosmeticsData = data
+ this.playerHasACosmeticA = !!data[Player.getUUID().toString()]
this.scanForNewCosmetics()
}
@@ -88,6 +91,7 @@ class Cosmetics extends Feature {
if(this.shouldPlayerHaveCosmetic(player, "dragon_wings") && !this.uuidToCosmetic[player.getUUID().toString()]){
let cosmetic = new DragonWings(player, this)
+ this.playerHasACosmeticA = true
this.loadedCosmetics.push(cosmetic)
this.uuidToCosmetic[player.getUUID().toString()] = cosmetic
}
@@ -134,6 +138,7 @@ class Cosmetics extends Feature {
initVariables(){
this.loadedCosmetics = undefined
this.uuidToCosmetic = undefined
+ this.playerHasACosmeticA = undefined
}
onDisable(){