aboutsummaryrefslogtreecommitdiff
path: root/features/waypoints
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-23 13:19:19 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-23 13:19:19 +0800
commitb4111d1e0895559f800e275fbbae98a86ac11e7d (patch)
treec08770b446717a3420d45fc716b76f4e703afb03 /features/waypoints
parent5595ba9f25365aad0c5aaa1b3641f0617d869834 (diff)
downloadSoopyV2-b4111d1e0895559f800e275fbbae98a86ac11e7d.tar.gz
SoopyV2-b4111d1e0895559f800e275fbbae98a86ac11e7d.tar.bz2
SoopyV2-b4111d1e0895559f800e275fbbae98a86ac11e7d.zip
+ dulkur thingo
+ DinkDonk for piller only happens when ur boss is spawned
Diffstat (limited to 'features/waypoints')
-rw-r--r--features/waypoints/index.js58
1 files changed, 29 insertions, 29 deletions
diff --git a/features/waypoints/index.js b/features/waypoints/index.js
index 8c4be05..47806ec 100644
--- a/features/waypoints/index.js
+++ b/features/waypoints/index.js
@@ -12,7 +12,7 @@ class Waypoints extends Feature {
super()
}
- onEnable(){
+ onEnable() {
this.initVariables()
new SettingBase("/addwaypoint [name] [x] [y] [z] [r?] [g?] [b?] [area?]", "Allows you to create a waypoint", undefined, "create_waypoint", this)
@@ -28,68 +28,68 @@ class Waypoints extends Feature {
this.registerForge(RenderWorldLastEvent, this.renderWorldLast)
- this.registerCommand("addwaypoint", (name, x=Math.floor(Player.getX()).toString(), y=Math.floor(Player.getY()).toString(), z=Math.floor(Player.getZ()).toString(), r="0", g="255", b="0", area)=>{
+ this.registerCommand("addwaypoint", (name, x = Math.floor(Player.getX()).toString(), y = Math.floor(Player.getY()).toString(), z = Math.floor(Player.getZ()).toString(), r = "0", g = "255", b = "0", area = "") => {
let lx = 0
let ly = 0
let lz = 0
- if(Player.lookingAt().getX){
+ if (Player.lookingAt().getX) {
lx = Player.lookingAt().getX()
ly = Player.lookingAt().getY()
lz = Player.lookingAt().getZ()
- if(Player.lookingAt().getWidth){
+ if (Player.lookingAt().getWidth) {
lx += -0.5
lz += -0.5
}
}
-
+
this.userWaypoints[name] = {
x: parseFloat(x.replace("l", lx).replace('p', Math.floor(Player.getX()))),
y: parseFloat(y.replace("l", ly).replace('p', Math.floor(Player.getY()))),
z: parseFloat(z.replace("l", lz).replace('p', Math.floor(Player.getZ()))),
- r: parseInt(r)/255,
- g: parseInt(g)/255,
- b: parseInt(b)/255,
- area: area==="a"?this.FeatureManager.features["dataLoader"].class.area:area.replace(/_/g," "),
- options: {name: ChatLib.addColor(name.replace(/_/g," "))}
+ r: parseInt(r) / 255,
+ g: parseInt(g) / 255,
+ b: parseInt(b) / 255,
+ area: area === "a" ? this.FeatureManager.features["dataLoader"].class.area : area.replace(/_/g, " "),
+ options: { name: ChatLib.addColor(name.replace(/_/g, " ")) }
}
-
+
this.userWaypointsArr = Object.values(this.userWaypoints)
this.waypointsChanged = true
- ChatLib.chat(this.FeatureManager.messagePrefix + "Added waypoint "+ name + "!")
+ ChatLib.chat(this.FeatureManager.messagePrefix + "Added waypoint " + name + "!")
})
- this.registerCommand("delwaypoint", (name)=>{
+ this.registerCommand("delwaypoint", (name) => {
delete this.userWaypoints[name]
this.userWaypointsArr = Object.values(this.userWaypoints)
this.waypointsChanged = true
- ChatLib.chat(this.FeatureManager.messagePrefix + "Deleted waypoint "+ name + "!")
+ ChatLib.chat(this.FeatureManager.messagePrefix + "Deleted waypoint " + name + "!")
})
- this.registerCommand("clearwaypoints", ()=>{
+ this.registerCommand("clearwaypoints", () => {
this.userWaypoints = {}
this.userWaypointsArr = []
this.waypointsChanged = true
ChatLib.chat(this.FeatureManager.messagePrefix + "Cleared waypoints!")
})
- this.registerCommand("savewaypoints", ()=>{
+ this.registerCommand("savewaypoints", () => {
Java.type("net.minecraft.client.gui.GuiScreen")[m.setClipboardString](JSON.stringify(this.userWaypoints))
ChatLib.chat(this.FeatureManager.messagePrefix + "Saved waypoints to clipboard!")
})
- this.registerCommand("loadwaypoints", ()=>{
- try{
+ this.registerCommand("loadwaypoints", () => {
+ try {
this.userWaypoints = JSON.parse(Java.type("net.minecraft.client.gui.GuiScreen")[m.getClipboardString]())
-
+
this.userWaypointsArr = Object.values(this.userWaypoints)
this.waypointsChanged = true
ChatLib.chat(this.FeatureManager.messagePrefix + "Loaded waypoints from clipboard!")
- }catch(e){
+ } catch (e) {
ChatLib.chat(this.FeatureManager.messagePrefix + "Error loading from clipboard!")
}
})
}
- addWaypoint(x, y, z, r, g, b, options){
+ addWaypoint(x, y, z, r, g, b, options) {
this.waypoints.push({
x: x,
y: y,
@@ -101,23 +101,23 @@ class Waypoints extends Feature {
})
}
- renderWorldLast(){
- for(let waypoint of this.waypoints){
+ renderWorldLast() {
+ for (let waypoint of this.waypoints) {
drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, waypoint.options)
}
- for(let waypoint of this.userWaypointsArr){ //TODO: Performance optimisation: Make hash from waypoint.area -> waypoints[]
- if(!waypoint.area || this.FeatureManager.features["dataLoader"].class.area === waypoint.area){
- drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, {...waypoint.options})
+ for (let waypoint of this.userWaypointsArr) { //TODO: Performance optimisation: Make hash from waypoint.area -> waypoints[]
+ if (!waypoint.area || this.FeatureManager.features["dataLoader"].class.area === waypoint.area) {
+ drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, { ...waypoint.options })
}
}
}
- initVariables(){
+ initVariables() {
this.waypoints = undefined
}
- onDisable(){
- if(this.waypointsChanged){
+ onDisable() {
+ if (this.waypointsChanged) {
FileLib.write("soopyAddonsData", "soopyv2userwaypoints.json", JSON.stringify(this.userWaypoints))
}