From c71b4f83abb2697781f8e6eafa8ad35f924fbdf7 Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Tue, 1 Mar 2022 21:25:13 +0800
Subject: many changes (will list in a bit)
---
features/performance/hiddenRequirement.js | 7 ++
features/performance/index.js | 127 ++++++++++++++++++++++++++++++
features/performance/metadata.json | 8 ++
3 files changed, 142 insertions(+)
create mode 100644 features/performance/hiddenRequirement.js
create mode 100644 features/performance/index.js
create mode 100644 features/performance/metadata.json
(limited to 'features/performance')
diff --git a/features/performance/hiddenRequirement.js b/features/performance/hiddenRequirement.js
new file mode 100644
index 0000000..bc74bfc
--- /dev/null
+++ b/features/performance/hiddenRequirement.js
@@ -0,0 +1,7 @@
+let allowedUUIDS = [
+ "dc8c39647b294e03ae9ed13ebd65dd29"
+]
+
+module.exports = {hidden: function(featureManager){
+ return !allowedUUIDS.includes(Player.getUUID().toString().replace(/-/g, ""))
+}}
\ No newline at end of file
diff --git a/features/performance/index.js b/features/performance/index.js
new file mode 100644
index 0000000..4bc4002
--- /dev/null
+++ b/features/performance/index.js
@@ -0,0 +1,127 @@
+///
+///
+import Feature from "../../featureClass/class";
+import SettingBase from "../settings/settingThings/settingBase";
+import ToggleSetting from "../settings/settingThings/toggle";
+
+class Performance extends Feature {
+ constructor() {
+ super()
+ }
+
+ onEnable(){
+ new SettingBase("NOTE: If you dont use any of the features, disable this", "Having performance enabled will decrease performance if no features are used\n(this is due to it using the render entity event)", true, "hide_performance_description", this)
+
+ this.armourStandCapSetting = new ToggleSetting("Armorstand render cap", "Limits the max number of armor stands rendered to 50\n(50 closest to player)", true, "armorstand_render_cap", this)
+
+ this.entitysRenderingTemp = {}
+ this.entitysRendering = {}
+
+ this.dontRender = {}
+
+ // this.removeHiddenEnts = []
+
+ this.nextUpdateDontRender = 0
+ this.maxEntsRender = 50
+ this.armourstandClass = Java.type("net.minecraft.entity.item.EntityArmorStand").class
+ this.armourstandClassString = this.armourstandClass.toString()
+
+ this.registerStep(true, 5, this.updateDontRender)
+
+ this.registerEvent("renderEntity", this.renderEntity)
+ this.registerEvent("renderWorld", this.renderWorld)
+
+ // this.registerForge(net.minecraftforge.event.entity.living.LivingAttackEvent, this.entityAttackEvent);
+ }
+
+ // entityAttackEvent(event) { //TODO: maby make an actual feature for this (0ping 1tap)
+ // if (event.source.func_76346_g() === Player.getPlayer()) {
+ // if(event.entity.func_110143_aJ()<800000){
+
+ // let uuid = new Entity(event.entity).getUUID().toString()
+ // this.dontRender[uuid] = "hit"
+ // this.removeHiddenEnts.push([uuid, Date.now()+1000])
+ // }
+ // }
+ // }
+
+ renderWorld(){
+ if(!this.armourStandCapSetting.getValue()) return
+ this.entitysRendering = {}
+ Object.keys(this.entitysRenderingTemp).forEach(a=>{
+ this.entitysRendering[a] = true
+ })
+ this.entitysRenderingTemp = {}
+ }
+
+ updateDontRender(){
+ if(!this.armourStandCapSetting.getValue()) return
+
+ // this.removeHiddenEnts = this.removeHiddenEnts.filter(([uuid, time])=>{
+ // if(Date.now()