aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-08 20:14:22 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-08 20:14:22 +0800
commitdeec442b5c7d8b61c755f61aa61c4f1ef0bcecb3 (patch)
tree3c88b2b58fe1cb0a5faca1568400e3c4457db8b3
parent8d9679ca4e96c8f1423e839148d87ee024062837 (diff)
downloadSoopyV2-deec442b5c7d8b61c755f61aa61c4f1ef0bcecb3.tar.gz
SoopyV2-deec442b5c7d8b61c755f61aa61c4f1ef0bcecb3.tar.bz2
SoopyV2-deec442b5c7d8b61c755f61aa61c4f1ef0bcecb3.zip
+ make renderjavautils not clear all other render elements when a category is dev reloaded
-rw-r--r--utils/renderJavaUtils.js36
1 files changed, 18 insertions, 18 deletions
diff --git a/utils/renderJavaUtils.js b/utils/renderJavaUtils.js
index 0903986..f0c07db 100644
--- a/utils/renderJavaUtils.js
+++ b/utils/renderJavaUtils.js
@@ -16,45 +16,45 @@ let RenderBeaconC = Java.type("me.soopyboo32.soopyv2forge.RenderTypes.Beacon")
let HudPointsC = Java.type("me.soopyboo32.soopyv2forge.RenderTypes.HudPoints")
let HudTextC = Java.type("me.soopyboo32.soopyv2forge.RenderTypes.HudText")
-let RenderWorldThings = new Set()
-let RenderHudThings = new Set()
+global.soopyv2RenderWorldThings = new Set()
+global.soopyv2RenderHudThings = new Set()
register("gameUnload", () => {
- RenderWorldThings.clear()
+ global.soopyv2RenderWorldThings.clear()
SoopyV2Forge.setRenderWorldList(new ArrayList([]))
- RenderHudThings.clear()
+ global.soopyv2RenderHudThings.clear()
SoopyV2Forge.setRenderHudList(new ArrayList([]))
})
class RenderWorldAble {
startRender(isBatched) {
if (!canUseForgeRendering) return
- if (RenderWorldThings.has(this.javaObj)) return this
- RenderWorldThings.add(this.javaObj)
- if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...RenderWorldThings]))
+ if (global.soopyv2RenderWorldThings.has(this.javaObj)) return this
+ global.soopyv2RenderWorldThings.add(this.javaObj)
+ if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...global.soopyv2RenderWorldThings]))
return this
}
stopRender(isBatched) {
if (!canUseForgeRendering) return
- if (!RenderWorldThings.has(this.javaObj)) return this
- RenderWorldThings.delete(this.javaObj)
- if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...RenderWorldThings]))
+ if (!global.soopyv2RenderWorldThings.has(this.javaObj)) return this
+ global.soopyv2RenderWorldThings.delete(this.javaObj)
+ if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...global.soopyv2RenderWorldThings]))
return this
}
}
class RenderHudAble {
startRender() {
if (!canUseForgeRendering) return
- if (RenderHudThings.has(this.javaObj)) return this
- RenderHudThings.add(this.javaObj)
- SoopyV2Forge.setRenderHudList(new ArrayList([...RenderHudThings]))
+ if (global.soopyv2RenderHudThings.has(this.javaObj)) return this
+ global.soopyv2RenderHudThings.add(this.javaObj)
+ SoopyV2Forge.setRenderHudList(new ArrayList([...global.soopyv2RenderHudThings]))
return this
}
stopRender() {
if (!canUseForgeRendering) return
- if (!RenderHudThings.has(this.javaObj)) return this
- RenderHudThings.delete(this.javaObj)
- SoopyV2Forge.setRenderHudList(new ArrayList([...RenderHudThings]))
+ if (!global.soopyv2RenderHudThings.has(this.javaObj)) return this
+ global.soopyv2RenderHudThings.delete(this.javaObj)
+ SoopyV2Forge.setRenderHudList(new ArrayList([...global.soopyv2RenderHudThings]))
return this
}
}
@@ -343,7 +343,7 @@ export class Waypoint extends FilledBox {
if (this.params.name) this.textLine1.startRender(true)
if (this.params.showDist) this.textLine2.startRender(true)
- if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...RenderWorldThings]))
+ if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...global.soopyv2RenderWorldThings]))
return this
}
@@ -357,7 +357,7 @@ export class Waypoint extends FilledBox {
this.textLine1.stopRender(true)
this.textLine2.stopRender(true)
- if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...RenderWorldThings]))
+ if (!isBatched) SoopyV2Forge.setRenderWorldList(new ArrayList([...global.soopyv2RenderWorldThings]))
return this
}
}