diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-03-08 21:20:21 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-03-08 21:20:21 +0800 |
commit | 133f781e0838445bca104490c8ffe0b6398a876e (patch) | |
tree | 4fd5d2fc125ec3b812aec1e780720704746796bb /features/cosmetics/index.js | |
parent | 7ba09eb9ee619197849f3ed8de971e6bfab7d721 (diff) | |
download | SoopyV2-133f781e0838445bca104490c8ffe0b6398a876e.tar.gz SoopyV2-133f781e0838445bca104490c8ffe0b6398a876e.tar.bz2 SoopyV2-133f781e0838445bca104490c8ffe0b6398a876e.zip |
update meta + make dungeon map sync player locations thru socket
Diffstat (limited to 'features/cosmetics/index.js')
-rw-r--r-- | features/cosmetics/index.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js index d4b9fcb..e1879d0 100644 --- a/features/cosmetics/index.js +++ b/features/cosmetics/index.js @@ -50,7 +50,7 @@ class Cosmetics extends Feature { this.registerEvent("playerLeft", this.playerLeft) this.registerEvent("worldLoad", this.worldLoad) this.registerStep(false, 2, this.step) - this.registerEvent('worldUnload', ()=>{ + this.registerEvent('gameUnload', ()=>{ if(this.postRenderEntityTrigger){ this.postRenderEntityTrigger.unregister() this.postRenderEntityTrigger = undefined @@ -60,7 +60,6 @@ class Cosmetics extends Feature { // new Thread(()=>{this.loadCosmeticsData.call(this)}).start() // }) // this.registerEvent("renderEntity", this.renderEntity) - this.loadedRenderEntity = false if(global.soopyV2Server.userCosmeticPermissions){ this.updateUserCosmeticPermissionSettings() @@ -78,8 +77,8 @@ class Cosmetics extends Feature { } renderWorld(ticks){ - for(let cosmetic of this.loadedCosmetics){ - cosmetic.onRenderEntity(ticks, false) + for(let i = 0;i<this.loadedCosmetics.length;i++){ + this.loadedCosmetics[i].onRenderEntity(ticks, false) } } @@ -88,7 +87,7 @@ class Cosmetics extends Feature { this.cosmeticsData = data this.playerHasACosmeticA = !!data[Player.getUUID().toString().replace(/-/g,"")] - if(this.playerHasACosmeticA && !this.loadedRenderEntity){ + if(this.playerHasACosmeticA && !this.postRenderEntityTrigger){ // this.registerEvent("postRenderEntity", this.renderEntity) this.postRenderEntityTrigger = register("postRenderEntity", (entity, pos, ticks, event)=>{ if(ticks !== 1) return @@ -99,7 +98,6 @@ class Cosmetics extends Feature { } } }) - this.loadedRenderEntity = true } this.scanForNewCosmetics() |