///
///
import Feature from "../../featureClass/class";
import SettingBase from "../settings/settingThings/settingBase";
import ToggleSetting from "../settings/settingThings/toggle";
class Performance extends Feature {
constructor() {
super()
}
onEnable() {
return;
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()