diff options
author | Ninjune <enderknight537@gmail.com> | 2022-11-23 11:50:54 -0600 |
---|---|---|
committer | Ninjune <enderknight537@gmail.com> | 2022-11-23 11:50:54 -0600 |
commit | 9bb7bf0b2f4dbc9269b0e5fa446d8480b814fe20 (patch) | |
tree | 56837d423243990da63152d0e9c119189f1d121b /render/naturals.js | |
parent | 5e76b8b00ac668768f5295ac4b2cb7c79c71ee36 (diff) | |
download | coleweight-9bb7bf0b2f4dbc9269b0e5fa446d8480b814fe20.tar.gz coleweight-9bb7bf0b2f4dbc9269b0e5fa446d8480b814fe20.tar.bz2 coleweight-9bb7bf0b2f4dbc9269b0e5fa446d8480b814fe20.zip |
v1.6.4 forgot to push lmao
Diffstat (limited to 'render/naturals.js')
-rw-r--r-- | render/naturals.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/render/naturals.js b/render/naturals.js new file mode 100644 index 0000000..77a667d --- /dev/null +++ b/render/naturals.js @@ -0,0 +1,34 @@ +import axios from "../../axios" // USE AT YOUR OWN RISK disabled by default in this version because dragoonmaster4 wants me to confirm that this isn't bannable with admins before adding. +import settings from "../settings" +import constants from "../util/constants" +const PREFIX = constants.PREFIX +let coords = [] + +register("step", () => { + if(constants.serverData.map != "Crystal Hollows" || !settings.showNaturals) return + axios.get(`https://ninjune.dev/api/coords`) + .then((res) => { + coords = [] + res.data.filter(coord => + (((-1 * settings.naturalRange)/2 < (parseInt(Player.getX()) - coord.x)) && ((parseInt(Player.getX()) - coord.x) < settings.naturalRange/2) + && ((-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}) + }) + }) + .catch((err) => { + console.log(err) + }) +}).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) + }) +}) + +export default ""
\ No newline at end of file |