aboutsummaryrefslogtreecommitdiff
path: root/features/cosmetics/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-27 15:41:20 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-03-27 15:41:20 +0800
commit0cf3a67c2bbd4cdaa5d364436c9153e6456624f1 (patch)
tree03d6b37ee2f4109875050d61d63f363659031e6b /features/cosmetics/index.js
parentb94794a3de8827f4bddb5251b010dc32943d79a1 (diff)
downloadSoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.tar.gz
SoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.tar.bz2
SoopyV2-0cf3a67c2bbd4cdaa5d364436c9153e6456624f1.zip
make network requests all go on one permenantly open thread
Diffstat (limited to 'features/cosmetics/index.js')
-rw-r--r--features/cosmetics/index.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js
index ec8a094..98a848e 100644
--- a/features/cosmetics/index.js
+++ b/features/cosmetics/index.js
@@ -5,6 +5,7 @@ import DragonWings from "./cosmetic/dragon/dragonWings"
import Toggle from "../settings/settingThings/toggle"
import { f } from "../../../mappings/mappings";
import FakeRequireToggle from "../settings/settingThings/FakeRequireToggle";
+import { fetch } from "../../utils/networkUtils";
class Cosmetics extends Feature {
constructor() {
@@ -83,9 +84,7 @@ class Cosmetics extends Feature {
}
loadCosmeticsData(){
- try{
- let data = JSON.parse(FileLib.getUrlContent("http://soopymc.my.to/api/soopyv2/cosmetics.json"))
-
+ fetch("http://soopymc.my.to/api/soopyv2/cosmetics.json").json(data=>{
this.cosmeticsData = data
this.playerHasACosmeticA = !!data[Player.getUUID().toString().replace(/-/g,"")]
if(this.playerHasACosmeticA && !this.postRenderEntityTrigger){
@@ -102,7 +101,7 @@ class Cosmetics extends Feature {
}
this.scanForNewCosmetics()
- }catch(e){}
+ })
}
setUserCosmeticsInformation(uuid, cosmetics){