From 999ef1f72ba85d8534805f3b08a9084e792fbf04 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sat, 25 Dec 2021 00:25:52 +0800 Subject: CI 2 --- CI/supporttest.js | 1 + features/betterGuis/index.js | 2 +- features/dataLoader/index.js | 16 ++++++++++------ features/slayers/index.js | 24 ++++++++++++++++++------ 4 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 CI/supporttest.js diff --git a/CI/supporttest.js b/CI/supporttest.js new file mode 100644 index 0000000..161135b --- /dev/null +++ b/CI/supporttest.js @@ -0,0 +1 @@ +console.log("This is running nodejs code rn") \ No newline at end of file diff --git a/features/betterGuis/index.js b/features/betterGuis/index.js index c5f21f4..e9b7e8a 100644 --- a/features/betterGuis/index.js +++ b/features/betterGuis/index.js @@ -123,7 +123,7 @@ class BetterGuis extends Feature { if(this.museumGuiEnabled.getValue()) this.museumGui.tick.call(this.museumGui) if(this.replaceSbMenuClicks.getValue()){ - if(Player.getOpenedInventory().getName()==="SkyBlock Menu"){ + if(Player.getOpenedInventory() && Player.getOpenedInventory().getName()==="SkyBlock Menu"){ if(this.lastWindowId === 0){ this.lastWindowId = Player.getOpenedInventory().getWindowId() return; diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js index 43b0f7a..42d0ec5 100644 --- a/features/dataLoader/index.js +++ b/features/dataLoader/index.js @@ -69,12 +69,16 @@ class DataLoader extends Feature { step(){ //2fps this.stats["Area"] = undefined this.stats["Dungeon"] = undefined - TabList.getNames().forEach(n=>{ - n = ChatLib.removeFormatting(n) - if(n.includes(": ")){ - this.stats[n.split(": ")[0].trim()] = n.split(": ")[1].trim() - } - }) + + if(TabList && TabList.getNames()){ + TabList.getNames().forEach(n=>{ + n = ChatLib.removeFormatting(n) + if(n.includes(": ")){ + this.stats[n.split(": ")[0].trim()] = n.split(": ")[1].trim() + } + }) + } + if(this.stats["Dungeon"]){ this.stats["Area"] = this.stats["Dungeon"] this.isInDungeon = true 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)] + } } } } -- cgit