aboutsummaryrefslogtreecommitdiff
path: root/features/nether
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-22 12:48:12 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-04-22 12:48:12 +0800
commit2cfc95522fa4c28ebcd9d091bc0a0c5f80e1aaeb (patch)
tree55d0384f39d112b02e07aaaa7130436ff5dd1c44 /features/nether
parentdf6d64bd51ba041fe227eaee166735cad32afbf3 (diff)
downloadSoopyV2-2cfc95522fa4c28ebcd9d091bc0a0c5f80e1aaeb.tar.gz
SoopyV2-2cfc95522fa4c28ebcd9d091bc0a0c5f80e1aaeb.tar.bz2
SoopyV2-2cfc95522fa4c28ebcd9d091bc0a0c5f80e1aaeb.zip
Burrial location estimation
Diffstat (limited to 'features/nether')
-rw-r--r--features/nether/index.js40
1 files changed, 22 insertions, 18 deletions
diff --git a/features/nether/index.js b/features/nether/index.js
index d0f29ac..8606284 100644
--- a/features/nether/index.js
+++ b/features/nether/index.js
@@ -2,6 +2,7 @@
/// <reference lib="es2015" />
import { m } from "../../../mappings/mappings";
import Feature from "../../featureClass/class";
+import { drawBoxAtBlock } from "../../utils/renderUtils";
import ToggleSetting from "../settings/settingThings/toggle";
const MCBlock = Java.type("net.minecraft.block.Block");
@@ -24,29 +25,32 @@ class Nether extends Feature {
}
packetReceived(packet, event) {
+ if (!this.masteryTimer.getValue()) return
let packetType = new String(packet.class.getSimpleName()).valueOf()
- if (packetType !== "S23PacketBlockChange") return;
- let position = new BlockPos(packet[m.getBlockPosition.S23PacketBlockChange]())
- let blockState = this.getBlockIdFromState(packet[m.getBlockState.S23PacketBlockChange]())
- let oldBlockState = this.getBlockIdFromState(World.getBlockStateAt(position))
- if (oldBlockState === 20515 && blockState === 16419) {
- this.blocks.push({ loc: position, time: Date.now() + 3000 })
+ if (packetType === "S23PacketBlockChange") {
+ let position = new BlockPos(packet[m.getBlockPosition.S23PacketBlockChange]())
+ let blockState = this.getBlockIdFromState(packet[m.getBlockState.S23PacketBlockChange]())
+ let oldBlockState = this.getBlockIdFromState(World.getBlockStateAt(position))
+ if (oldBlockState === 20515 && blockState === 16419) {
+ this.blocks.push({ loc: position, time: Date.now() + 3000 })
+ }
+ if (blockState === 57379) {
+ this.blocks.filter(b => {
+ if (b.loc.x === position.x && b.loc.y === position.y && b.loc.z === position.z) {
+ return false
+ }
+ return true
+ })
+ //air=0
+ //green=20515
+ //yellow=16419
+ //red=57379
+ }
}
- if (blockState === 57379) {
- this.blocks.filter(b => {
- if (b.loc.x === position.x && b.loc.y === position.y && b.loc.z === position.z) {
- return false
- }
- return true
- })
- }
- //air=0
- //green=20515
- //yellow=16419
- //red=57379
}
renderWorld(event) {
+ if (!this.masteryTimer.getValue()) return
this.blocks.forEach(data => {
Tessellator.drawString(Math.max(0, (data.time - Date.now()) / 1000).toFixed(1) + "s", data.loc.getX() + 0.5, data.loc.getY() + 0.5, data.loc.getZ() + 0.5, 0, false, 0.05, false)
})