aboutsummaryrefslogtreecommitdiff
path: root/features/dungeonSolvers/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-15 21:15:02 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-15 21:15:02 +0800
commit55e969b24e891e1ac609ab0dc7a336ab69c1d08d (patch)
tree2d8af8a4e7e474ec971aa3bf40a494f7c16bb6b6 /features/dungeonSolvers/index.js
parent1e733f87be05ecf36c37cc9435a50a5a581c0246 (diff)
downloadSoopyV2-55e969b24e891e1ac609ab0dc7a336ab69c1d08d.tar.gz
SoopyV2-55e969b24e891e1ac609ab0dc7a336ab69c1d08d.tar.bz2
SoopyV2-55e969b24e891e1ac609ab0dc7a336ab69c1d08d.zip
make box blue when click
Diffstat (limited to 'features/dungeonSolvers/index.js')
-rw-r--r--features/dungeonSolvers/index.js169
1 files changed, 100 insertions, 69 deletions
diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js
index f56d8b5..33e090c 100644
--- a/features/dungeonSolvers/index.js
+++ b/features/dungeonSolvers/index.js
@@ -108,6 +108,7 @@ class DungeonSolvers extends Feature {
this.registerEvent("worldLoad", this.onWorldLoad)
this.registerEvent("renderOverlay", this.renderHud)
+ this.registerEvent("tick", this.tick)
this.registerEvent("renderWorld", this.renderWorld)
this.registerChat("&b&bYou are currently connected to server &6${*}&r", (e)=>{
@@ -142,83 +143,37 @@ class DungeonSolvers extends Feature {
}
if(this.bloodCampAssist.getValue()){
- this.skulls.forEach(skull => {
- let skullE = skull.getEntity()
- // renderUtils.drawBoxAtEntity(skull, 255, 0, 0, 0.5, 0.5, ticks)
-
- let xSpeed = skullE[f.posX.Entity]-skullE[f.lastTickPosX]
- let ySpeed = skullE[f.posY.Entity]-skullE[f.lastTickPosY]
- let zSpeed = skullE[f.posZ.Entity]-skullE[f.lastTickPosZ]
-
- if(this.eMovingThing[skull.getUUID().toString()] && this.eMovingThing[skull.getUUID().toString()].timeTook){
-
- let startPoint = [skullE[f.posX.Entity], skullE[f.posY.Entity], skullE[f.posZ.Entity]]
+ this.skulls.forEach(skull => {
+ let skullE = skull.getEntity()
+ // renderUtils.drawBoxAtEntity(skull, 255, 0, 0, 0.5, 0.5, ticks)
- let xSpeed2 = (startPoint[0]-this.eMovingThing[skull.getUUID().toString()].startX)/this.eMovingThing[skull.getUUID().toString()].timeTook
- let ySpeed2 = (startPoint[1]-this.eMovingThing[skull.getUUID().toString()].startY)/this.eMovingThing[skull.getUUID().toString()].timeTook
- let zSpeed2 = (startPoint[2]-this.eMovingThing[skull.getUUID().toString()].startZ)/this.eMovingThing[skull.getUUID().toString()].timeTook
-
- let time = (this.spawnIdThing>=4?2900:4850)-this.eMovingThing[skull.getUUID().toString()].timeTook
- let endPoint = [startPoint[0]+xSpeed2*time, startPoint[1]+ySpeed2*time, startPoint[2]+zSpeed2*time]
- let pingPoint = [startPoint[0]+xSpeed2*(this.ping), startPoint[1]+(ySpeed2*this.ping), startPoint[2]+(zSpeed2*this.ping)]
- renderUtils.drawLineWithDepth(startPoint[0], startPoint[1]+2, startPoint[2], endPoint[0], endPoint[1]+2, endPoint[2], 255, 0, 0, 2)
- renderUtils.drawBoxAtBlockNotVisThruWalls(pingPoint[0]-0.5, pingPoint[1]+1, pingPoint[2]-0.5, 0, 255, 0)
- renderUtils.drawBoxAtBlockNotVisThruWalls(endPoint[0]-0.5, endPoint[1]+1, endPoint[2]-0.5, 255, 0, 0)
-
- // if(this.eMovingThing[skull.getUUID().toString()] && this.eMovingThing[skull.getUUID().toString()].timeTook){
- // Tessellator.drawString((time/1000).toFixed(3)+"s", endPoint[0], endPoint[1]+2, endPoint[2])
- // }
- }
+ if(this.eMovingThing[skull.getUUID().toString()] && this.eMovingThing[skull.getUUID().toString()].timeTook){
+ let startPoint = [skullE[f.posX.Entity], skullE[f.posY.Entity], skullE[f.posZ.Entity]]
+
+ let xSpeed2 = (startPoint[0]-this.eMovingThing[skull.getUUID().toString()].startX)/this.eMovingThing[skull.getUUID().toString()].timeTook
+ let ySpeed2 = (startPoint[1]-this.eMovingThing[skull.getUUID().toString()].startY)/this.eMovingThing[skull.getUUID().toString()].timeTook
+ let zSpeed2 = (startPoint[2]-this.eMovingThing[skull.getUUID().toString()].startZ)/this.eMovingThing[skull.getUUID().toString()].timeTook
- //TODO: move this out of render world
+ let time = (this.spawnIdThing>=4?2900:4850)-this.eMovingThing[skull.getUUID().toString()].timeTook
+ let endPoint = this.eMovingThing[skull.getUUID().toString()].endPoint
+ let pingPoint = [startPoint[0]+xSpeed2*(this.ping), startPoint[1]+(ySpeed2*this.ping), startPoint[2]+(zSpeed2*this.ping)]
- if(this.eMovingThing[skull.getUUID().toString()] && Date.now()-this.eMovingThing[skull.getUUID().toString()].startMovingTime > 5000){
- this.eMovingThing[skull.getUUID().toString()].logged = true
- this.spawnIdThing++
+ renderUtils.drawLineWithDepth(startPoint[0], startPoint[1]+2, startPoint[2], endPoint[0], endPoint[1]+2, endPoint[2], 255, 0, 0, 2)
- delete this.eMovingThing[skull.getUUID().toString()]
- this.skulls = this.skulls.filter(e=>{
- if(e.getUUID().toString() === skull.getUUID().toString()){
- return false
+ if(this.ping < time){
+ renderUtils.drawBoxAtBlockNotVisThruWalls(pingPoint[0]-0.5, pingPoint[1]+1.5, pingPoint[2]-0.5, 0, 255, 0)
+ renderUtils.drawBoxAtBlockNotVisThruWalls(endPoint[0]-0.5, endPoint[1]+1.5, endPoint[2]-0.5, 255, 0, 0)
+ }else{
+ renderUtils.drawBoxAtBlockNotVisThruWalls(endPoint[0]-0.5, endPoint[1]+1.5, endPoint[2]-0.5, 0, 0, 255)
}
- return true
- })
- return
- }
-
- if(xSpeed !== 0 || ySpeed !== 0){
- if(!this.eMovingThing[skull.getUUID().toString()])this.eMovingThing[skull.getUUID().toString()] = {startMovingTime: Date.now(),startX: skullE[f.posX.Entity],startY: skullE[f.posY.Entity],startZ: skullE[f.posZ.Entity]}
-
- if(this.eMovingThing[skull.getUUID().toString()].lastX !== skullE[f.posX.Entity]
- || this.eMovingThing[skull.getUUID().toString()].lastY !== skullE[f.posY.Entity]){
- this.eMovingThing[skull.getUUID().toString()].timeTook = Date.now()-this.eMovingThing[skull.getUUID().toString()].startMovingTime
- }else if(!this.eMovingThing[skull.getUUID().toString()].logged && (
- skullE[f.isDead]
- || !skullE[m.getEquipmentInSlot](4)
- || !skullE[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith("Head")
- )){
- this.eMovingThing[skull.getUUID().toString()].logged = true
- this.spawnIdThing++
-
- delete this.eMovingThing[skull.getUUID().toString()]
- this.skulls = this.skulls.filter(e=>{
- if(e.getUUID().toString() === skull.getUUID().toString()){
- return false
- }
- return true
- })
- return
+ // if(this.eMovingThing[skull.getUUID().toString()] && this.eMovingThing[skull.getUUID().toString()].timeTook){
+ // Tessellator.drawString((time/1000).toFixed(3)+"s", endPoint[0], endPoint[1]+2, endPoint[2])
+ // }
}
-
- this.eMovingThing[skull.getUUID().toString()].lastX= skullE[f.posX.Entity]
- this.eMovingThing[skull.getUUID().toString()].lastY= skullE[f.posY.Entity]
-
- if(!this.startSpawningTime) this.startSpawningTime = Date.now()
- }
- })
- }
+ })
+ }
}
renderEntity(entity, position, ticks, event){
@@ -258,6 +213,82 @@ class DungeonSolvers extends Feature {
})
}
+ tick(){
+
+ if(this.bloodCampAssist.getValue()){
+ this.skulls.forEach(skull => {
+ let skullE = skull.getEntity()
+ // renderUtils.drawBoxAtEntity(skull, 255, 0, 0, 0.5, 0.5, ticks)
+
+ let xSpeed = skullE[f.posX.Entity]-skullE[f.lastTickPosX]
+ let ySpeed = skullE[f.posY.Entity]-skullE[f.lastTickPosY]
+ let zSpeed = skullE[f.posZ.Entity]-skullE[f.lastTickPosZ]
+
+ if(this.eMovingThing[skull.getUUID().toString()] && Date.now()-this.eMovingThing[skull.getUUID().toString()].startMovingTime > 5000){
+ this.eMovingThing[skull.getUUID().toString()].logged = true
+ this.spawnIdThing++
+
+ delete this.eMovingThing[skull.getUUID().toString()]
+ this.skulls = this.skulls.filter(e=>{
+ if(e.getUUID().toString() === skull.getUUID().toString()){
+ return false
+ }
+ return true
+ })
+ return
+ }
+
+ if(xSpeed !== 0 || ySpeed !== 0){
+ if(!this.eMovingThing[skull.getUUID().toString()])this.eMovingThing[skull.getUUID().toString()] = {startMovingTime: Date.now(),startX: skullE[f.posX.Entity],startY: skullE[f.posY.Entity],startZ: skullE[f.posZ.Entity]}
+
+
+ if(this.eMovingThing[skull.getUUID().toString()].lastX !== skullE[f.posX.Entity]
+ || this.eMovingThing[skull.getUUID().toString()].lastY !== skullE[f.posY.Entity]){
+ this.eMovingThing[skull.getUUID().toString()].timeTook = Date.now()-this.eMovingThing[skull.getUUID().toString()].startMovingTime
+ }else if(!this.eMovingThing[skull.getUUID().toString()].logged && (
+ skullE[f.isDead]
+ || !skullE[m.getEquipmentInSlot](4)
+ || !skullE[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith("Head")
+ )){
+ this.eMovingThing[skull.getUUID().toString()].logged = true
+ this.spawnIdThing++
+
+ delete this.eMovingThing[skull.getUUID().toString()]
+ this.skulls = this.skulls.filter(e=>{
+ if(e.getUUID().toString() === skull.getUUID().toString()){
+ return false
+ }
+ return true
+ })
+ return
+ }
+
+ this.eMovingThing[skull.getUUID().toString()].lastX= skullE[f.posX.Entity]
+ this.eMovingThing[skull.getUUID().toString()].lastY= skullE[f.posY.Entity]
+
+ if(!this.startSpawningTime) this.startSpawningTime = Date.now()
+ }
+
+ if(this.eMovingThing[skull.getUUID().toString()] && this.eMovingThing[skull.getUUID().toString()].timeTook){
+
+ let startPoint = [skullE[f.posX.Entity], skullE[f.posY.Entity], skullE[f.posZ.Entity]]
+
+ let xSpeed2 = (startPoint[0]-this.eMovingThing[skull.getUUID().toString()].startX)/this.eMovingThing[skull.getUUID().toString()].timeTook
+ let ySpeed2 = (startPoint[1]-this.eMovingThing[skull.getUUID().toString()].startY)/this.eMovingThing[skull.getUUID().toString()].timeTook
+ let zSpeed2 = (startPoint[2]-this.eMovingThing[skull.getUUID().toString()].startZ)/this.eMovingThing[skull.getUUID().toString()].timeTook
+
+ let time = (this.spawnIdThing>=4?2900:4850)-this.eMovingThing[skull.getUUID().toString()].timeTook
+ let endPoint = [startPoint[0]+xSpeed2*time, startPoint[1]+ySpeed2*time, startPoint[2]+zSpeed2*time]
+ this.eMovingThing[skull.getUUID().toString()].endPoint = endPoint
+
+ // if(this.eMovingThing[skull.getUUID().toString()] && this.eMovingThing[skull.getUUID().toString()].timeTook){
+ // Tessellator.drawString((time/1000).toFixed(3)+"s", endPoint[0], endPoint[1]+2, endPoint[2])
+ // }
+ }
+ })
+ }
+ }
+
addSkull(skull){
if(this.bloodX !== -1){
let xA = skull.getX()-(skull.getX()%32)