aboutsummaryrefslogtreecommitdiff
path: root/features/slayers
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-25 00:25:52 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-12-25 00:25:52 +0800
commit999ef1f72ba85d8534805f3b08a9084e792fbf04 (patch)
tree17988ab21fed4980141e7755e974431430bf07ce /features/slayers
parent6695867c01a718d20800394fe0685fba598e57b6 (diff)
downloadSoopyV2-999ef1f72ba85d8534805f3b08a9084e792fbf04.tar.gz
SoopyV2-999ef1f72ba85d8534805f3b08a9084e792fbf04.tar.bz2
SoopyV2-999ef1f72ba85d8534805f3b08a9084e792fbf04.zip
CI 2
Diffstat (limited to 'features/slayers')
-rw-r--r--features/slayers/index.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js
index c09efd7..2ebe0fe 100644
--- a/features/slayers/index.js
+++ b/features/slayers/index.js
@@ -206,7 +206,7 @@ class Slayers extends Feature {
}
- this.todoE.forEach(e=>{
+ this.todoE.forEach((e)=>{
try{
if(e instanceof net.minecraft.entity.item.EntityArmorStand && e[m.getEquipmentInSlot](4)){
if(e[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]() === "Beacon"){
@@ -264,11 +264,23 @@ class Slayers extends Feature {
let pos = [e[f.posX.Entity]+0.5, e[f.posY.Entity]+0.7, e[f.posZ.Entity]+0.5]
//check for a beacon block within 5 blocks of pos
- for(let x = pos[0] - 5; x <= pos[0] + 5; x++){
- for(let y = pos[1] - 5; y <= pos[1] + 5; y++){
- for(let z = pos[2] - 5; z <= pos[2] + 5; z++){
- if(World.getBlockAt(Math.floor(x), Math.floor(y), Math.floor(z)).getID() === 138){
- this.beaconLocations[e[m.getUniqueID.Entity]().toString()] = [Math.floor(x), Math.floor(y), Math.floor(z)]
+ if(World.getBlockAt(0,0,0).getID){
+ for(let x = pos[0] - 5; x <= pos[0] + 5; x++){
+ for(let y = pos[1] - 5; y <= pos[1] + 5; y++){
+ for(let z = pos[2] - 5; z <= pos[2] + 5; z++){
+ if(World.getBlockAt(Math.floor(x), Math.floor(y), Math.floor(z)).getID() === 138){
+ this.beaconLocations[e[m.getUniqueID.Entity]().toString()] = [Math.floor(x), Math.floor(y), Math.floor(z)]
+ }
+ }
+ }
+ }
+ }else{ //CT 2.0 support
+ for(let x = pos[0] - 5; x <= pos[0] + 5; x++){
+ for(let y = pos[1] - 5; y <= pos[1] + 5; y++){
+ for(let z = pos[2] - 5; z <= pos[2] + 5; z++){
+ if(World.getBlockAt(Math.floor(x), Math.floor(y), Math.floor(z)).getType().getID() === 138){
+ this.beaconLocations[e[m.getUniqueID.Entity]().toString()] = [Math.floor(x), Math.floor(y), Math.floor(z)]
+ }
}
}
}