aboutsummaryrefslogtreecommitdiff
path: root/features/hud/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-01 20:25:17 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-01 20:25:17 +0800
commitb5f6c8eafcb5c3fc0e5389f5927dc85bbbafba96 (patch)
treec42f52891286f7a3b7ec4e595697b4a110e4fb67 /features/hud/index.js
parent7483831198865f501c832f8f1f46c8fa95ccd197 (diff)
downloadSoopyV2-b5f6c8eafcb5c3fc0e5389f5927dc85bbbafba96.tar.gz
SoopyV2-b5f6c8eafcb5c3fc0e5389f5927dc85bbbafba96.tar.bz2
SoopyV2-b5f6c8eafcb5c3fc0e5389f5927dc85bbbafba96.zip
update!
Diffstat (limited to 'features/hud/index.js')
-rw-r--r--features/hud/index.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/features/hud/index.js b/features/hud/index.js
index 92d91bd..b0bf45d 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -276,8 +276,6 @@ class Hud extends Feature {
this.registerActionBar("${m}", this.actionbarMessage)
- this.registerCustom("packetReceived", this.packetReceived)
-
this.packetMoves = 0
this.secondPackets = 0
this.tps = -2
@@ -286,12 +284,14 @@ class Hud extends Feature {
this.registerStep(false, 1, this.step_1second)
}
- packetReceived(packet) {
- this.packetMoves++
- }
-
step_1second() {
- if (!this.lagEnabled.getValue()) return
+ if (!this.lagEnabled.getValue()) {
+ if (this.packetReceived) this.packetReceived.unregister()
+ return
+ }
+ if (!this.packetReceived) this.packetReceived = register("packetReceived", () => {
+ this.packetMoves++
+ })
this.lastTps.push(this.secondPackets)
if (this.lastTps.length > 10) this.lastTps.shift()
if (this.tps === -2) {
@@ -322,6 +322,8 @@ class Hud extends Feature {
this.cpsEnabledSetting.delete()
this.initVariables()
+
+ if (this.packetReceived) this.packetReceived.unregister()
}
renderHud() {
@@ -542,7 +544,7 @@ class Hud extends Feature {
if (this.lastStatData.itemsData.talisman_bag) {
let isSoulflowCounting = false
- this.lastStatData.itemsData.talisman_bag.toString().split(",").forEach(line => {
+ this.lastStatData.itemsData.talisman_bag.toString().split(",").forEach(line => { //omega scuffed because i cba actually using the nbt like a normal person
if (isSoulflowCounting) {
this.lastStatData._soulflow *= 1000
this.lastStatData._soulflow += parseInt(ChatLib.removeFormatting(line.split(` `)[0]).replace(/[^0-9]/g, ""))