aboutsummaryrefslogtreecommitdiff
path: root/render/naturals.js
diff options
context:
space:
mode:
Diffstat (limited to 'render/naturals.js')
-rw-r--r--render/naturals.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/render/naturals.js b/render/naturals.js
index d0443a3..595c32d 100644
--- a/render/naturals.js
+++ b/render/naturals.js
@@ -1,9 +1,11 @@
import axios from "../../axios"
import settings from "../settings"
import constants from "../util/constants"
+import { waypointRender } from "../util/helperFunctions"
const PREFIX = constants.PREFIX
let coords = []
+
register("step", () => {
if(constants.serverData.map != "Crystal Hollows") return
axios.get(`https://ninjune.dev/api/coords`)
@@ -14,7 +16,7 @@ register("step", () => {
&& ((-1 * settings.naturalRange)/2 < (parseInt(Player.getY()) - coord.y)) && ((parseInt(Player.getY()) - coord.y) < settings.naturalRange/2)
&& ((-1 * settings.naturalRange)/2 < (parseInt(Player.getZ()) - coord.z)) && ((parseInt(Player.getZ()) - coord.z) < settings.naturalRange/2))
).forEach(coord => {
- coords.push({x: coord.x, y: coord.y, z: coord.z})
+ coords.push([coord.x, coord.y, coord.z])
})
})
.catch((err) => {
@@ -22,13 +24,16 @@ register("step", () => {
})
}).setFps(1)
+
register("renderWorld", () => {
if(!settings.showNaturals) return
if(coords.length < 1) return
- coords
- .forEach((coord) => {
- Tessellator.drawString(Math.floor((Math.abs(parseInt(Player.getX()) - coord.x) + Math.abs(parseInt(Player.getY()) - coord.y) + Math.abs(parseInt(Player.getZ()) - coord.z))/3) + "m", coord.x, coord.y, coord.z)
- })
+ waypointRender(coords)
})
+register("worldUnload", () => {
+ coords = []
+})
+
+
export default "" \ No newline at end of file