aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
Diffstat (limited to 'features')
-rw-r--r--features/bestiary/index.js37
-rw-r--r--features/bestiary/metadata.json8
-rw-r--r--features/eventsGUI/index.js51
-rw-r--r--features/eventsGUI/metadata.json8
-rw-r--r--features/globalSettings/index.js4
-rw-r--r--features/performance/index.js50
6 files changed, 133 insertions, 25 deletions
diff --git a/features/bestiary/index.js b/features/bestiary/index.js
new file mode 100644
index 0000000..3888ffb
--- /dev/null
+++ b/features/bestiary/index.js
@@ -0,0 +1,37 @@
+/// <reference types="../../../CTAutocomplete" />
+/// <reference lib="es2015" />
+import { m } from "../../../mappings/mappings";
+import Feature from "../../featureClass/class";
+import { drawCoolWaypoint } from "../../utils/renderUtils";
+import SettingBase from "../settings/settingThings/settingBase";
+import ToggleSetting from "../settings/settingThings/toggle";
+
+
+class Waypoints extends Feature {
+ constructor() {
+ super()
+ }
+
+ onEnable() {
+ this.initVariables()
+
+ this.bestiaryData = JSON.parse(FileLib.read("soopyAddonsData", "bestiaryData.json") || "{}")
+ this.bestiaryChanged = false
+ }
+
+ initVariables() {
+
+ }
+
+ onDisable() {
+ if (this.bestiaryChanged) {
+ FileLib.write("soopyAddonsData", "bestiaryData.json", JSON.stringify(this.bestiaryData))
+ }
+
+ this.initVariables()
+ }
+}
+
+module.exports = {
+ class: new Waypoints()
+}
diff --git a/features/bestiary/metadata.json b/features/bestiary/metadata.json
new file mode 100644
index 0000000..3ff9383
--- /dev/null
+++ b/features/bestiary/metadata.json
@@ -0,0 +1,8 @@
+{
+ "name": "Bestiary",
+ "description": "Bestiary trackers",
+ "isHidden": false,
+ "isTogglable": true,
+ "defaultEnabled": true,
+ "sortA": 0
+} \ No newline at end of file
diff --git a/features/eventsGUI/index.js b/features/eventsGUI/index.js
new file mode 100644
index 0000000..c828f85
--- /dev/null
+++ b/features/eventsGUI/index.js
@@ -0,0 +1,51 @@
+/// <reference types="../../../CTAutocomplete" />
+/// <reference lib="es2015" />
+import BoxWithLoading from "../../../guimanager/GuiElement/BoxWithLoading";
+import Feature from "../../featureClass/class";
+import GuiPage from "../soopyGui/GuiPage";
+
+class EventsGui extends Feature {
+ constructor() {
+ super()
+ }
+
+ onEnable() {
+ this.initVariables()
+
+ // this.GuiPage = new EventsPage() //TODO: SOON(tm)
+
+ // this.registerChat("&9&m-----------------------------------------------------&r&9${*}&r&9 ${*} &6Friends (Page ${pagenum} of ${maxpages})${friendslist}&r&9&m-----------------------------------------------------&r", (...args) => { this.GuiPage.friendListMessageEvent.call(this.GuiPage, ...args) })
+ // this.registerStep(true, 5, () => { this.GuiPage.regenGuiElements.call(this.GuiPage) })
+ }
+
+ initVariables() {
+ this.GuiPage = undefined
+ }
+
+ onDisable() {
+ this.initVariables()
+ }
+}
+
+
+class EventsPage extends GuiPage {
+ constructor() {
+ super(8)
+
+ this.name = "Guild Events"
+
+ this.pages = [this.newPage()]
+
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+
+ this.finaliseLoading()
+ }
+
+ onOpen() {
+
+ }
+}
+
+module.exports = {
+ class: new EventsGui()
+} \ No newline at end of file
diff --git a/features/eventsGUI/metadata.json b/features/eventsGUI/metadata.json
new file mode 100644
index 0000000..b7b1f6f
--- /dev/null
+++ b/features/eventsGUI/metadata.json
@@ -0,0 +1,8 @@
+{
+ "name": "Friends gui",
+ "description": "Gui for friends",
+ "isHidden": true,
+ "isTogglable": false,
+ "defaultEnabled": true,
+ "sortA": 0
+} \ No newline at end of file
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
index b77fd0e..39a2714 100644
--- a/features/globalSettings/index.js
+++ b/features/globalSettings/index.js
@@ -73,6 +73,10 @@ class GlobalSettings extends Feature {
this.registerEvent("tick", this.fixNEU)
}
+ if (net.minecraftforge.fml.common.Loader.isModLoaded("SoopyV2")) {
+
+ }
+
this.registerCommand("soopyweight", (user = Player.getName()) => {
this.soopyWeight(user)
})
diff --git a/features/performance/index.js b/features/performance/index.js
index a80240a..22a37fc 100644
--- a/features/performance/index.js
+++ b/features/performance/index.js
@@ -9,7 +9,7 @@ class Performance extends Feature {
super()
}
- onEnable(){
+ 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)
@@ -46,17 +46,17 @@ class Performance extends Feature {
// }
// }
- renderWorld(){
- if(!this.armourStandCapSetting.getValue()) return
+ renderWorld() {
+ if (!this.armourStandCapSetting.getValue()) return
this.entitysRendering = {}
- Object.keys(this.entitysRenderingTemp).forEach(a=>{
+ Object.keys(this.entitysRenderingTemp).forEach(a => {
this.entitysRendering[a] = true
})
this.entitysRenderingTemp = {}
}
- updateDontRender(){
- if(!this.armourStandCapSetting.getValue()) return
+ updateDontRender() {
+ if (!this.armourStandCapSetting.getValue()) return
// this.removeHiddenEnts = this.removeHiddenEnts.filter(([uuid, time])=>{
// if(Date.now()<time) return true
@@ -65,18 +65,18 @@ class Performance extends Feature {
// })
// try{
let start = Date.now()
- if(start < this.nextUpdateDontRender) return
+ if (start < this.nextUpdateDontRender) return
let entities = World.getAllEntitiesOfType(this.armourstandClass)
let Ents = new Array(100)
- for(let i = 0; i < entities.length; i++){
+ for (let i = 0; i < entities.length; i++) {
// if(this.dontRender[entities[i].getUUID().toString()] === "hit") continue
- if(!this.entitysRendering[entities[i].getUUID().toString()]){
+ if (!this.entitysRendering[entities[i].getUUID().toString()]) {
delete this.dontRender[entities[i].getUUID().toString()]
continue //not rendering
}
- let dist = (Player.getX()-entities[i].getX())**2+(Player.getY()-entities[i].getY())**2+(Player.getZ()-entities[i].getZ())**2
- if(dist > 100**2){
+ let dist = (Player.getX() - entities[i].getX()) ** 2 + (Player.getY() - entities[i].getY()) ** 2 + (Player.getZ() - entities[i].getZ()) ** 2
+ if (dist > 100 ** 2) {
this.dontRender[entities[i].getUUID().toString()] = true
continue
}
@@ -86,12 +86,12 @@ class Performance extends Feature {
}
let entsNumber = 0
- for(let i = 0; i < Ents.length; i++){
+ for (let i = 0; i < Ents.length; i++) {
let entsNumberTemp = entsNumber
- while(Ents[i]){
- if(entsNumber > this.maxEntsRender){
+ while (Ents[i]) {
+ if (entsNumber > this.maxEntsRender) {
this.dontRender[Ents[i][0].getUUID().toString()] = true
- }else{
+ } else {
delete this.dontRender[Ents[i][0].getUUID().toString()]
}
@@ -100,25 +100,25 @@ class Performance extends Feature {
}
entsNumber = entsNumberTemp
}
- let timeTook = Date.now()-start
+ let timeTook = Date.now() - start
// console.log(`Update took ${timeTook}ms | ${entsNumber} ents`)
- this.nextUpdateDontRender = Date.now()+100+10*timeTook
- // }catch(e){
- // //cucurrent modification
- // }
+ this.nextUpdateDontRender = Date.now() + 100 + 10 * timeTook
+ // }catch(e){
+ // //cucurrent modification
+ // }
}
- renderEntity(e, pos, ticks, event){
- if(!this.armourStandCapSetting.getValue()) return
- if(!e.getEntity().class.toString()===this.armourstandClassString) return
+ renderEntity(e, pos, ticks, event) {
+ if (!this.armourStandCapSetting.getValue()) return
+ if (!e.getEntity().class.toString() === this.armourstandClassString) return
this.entitysRenderingTemp[e.getUUID().toString()] = true
- if(this.dontRender[e.getUUID().toString()]){
+ if (this.dontRender[e.getUUID().toString()]) {
cancel(event)
return
}
}
- onDisable(){
+ onDisable() {
this.running = false
}
}