diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-03-04 07:51:39 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-03-04 07:51:39 +0800 |
commit | 4784af7103fb0bd45aad28a662ed44297ac7e0b8 (patch) | |
tree | 006e5ca1023dba398bbb2602e8c1b00fe963ddb6 /features | |
parent | 6b4f91e27d037b10e6c242352211e2774c34573e (diff) | |
download | SoopyV2-4784af7103fb0bd45aad28a662ed44297ac7e0b8.tar.gz SoopyV2-4784af7103fb0bd45aad28a662ed44297ac7e0b8.tar.bz2 SoopyV2-4784af7103fb0bd45aad28a662ed44297ac7e0b8.zip |
Fix command registering breaking
Fix dungeon map and solvers breaking with new map offset
Dungeon map Use items instead of text to show puzzles
Allow for cata over 50 in hud stat
Diffstat (limited to 'features')
-rw-r--r-- | features/dungeonMap/index.js | 48 | ||||
-rw-r--r-- | features/dungeonSolvers/index.js | 41 | ||||
-rw-r--r-- | features/hud/index.js | 2 |
3 files changed, 70 insertions, 21 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js index 310c220..2f82022 100644 --- a/features/dungeonMap/index.js +++ b/features/dungeonMap/index.js @@ -49,6 +49,21 @@ class DungeonMap extends Feature { this.renderImage = new BufferedImage(this.IMAGE_SIZE,this.IMAGE_SIZE, BufferedImage.TYPE_INT_ARGB) this.mapImage = new Image(this.renderImage) + this.barrier_block_item = new Item("minecraft:barrier") + this.puzzleItems = { + "Water Board": new Item("minecraft:water_bucket"), + "Higher Or Lower": new Item("minecraft:blaze_powder"), + "Quiz": new Item("minecraft:book"), + "Three Weirdos": new Item("minecraft:chest"), + "Tic Tac Toe": new Item("minecraft:shears"), + "Teleport Maze": new Item("minecraft:end_portal_frame"), + "Ice Fill": new Item("minecraft:ice"), + "Creeper Beams": new Item("minecraft:sea_lantern"), + "Bomb Defuse": new Item("minecraft:tnt"), + "Boulder": new Item("minecraft:planks"), + "Ice Path": new Item("minecraft:mob_spawner") + } + this.mapLocation = [10,10] this.mapRenderScale = 128/this.IMAGE_SIZE @@ -128,16 +143,18 @@ class DungeonMap extends Feature { drawOtherMisc(x2, y2, size2, scale){ Object.keys(this.puzzles).forEach(loc=>{ - if(!this.puzzles[loc]) return - let x = loc%128 - let y = Math.floor(loc/128) + if(!this.puzzles[loc]) return + if(this.puzzles[loc][1]) return + let y = loc%128 + let x = Math.floor(loc/128) - let lines = this.puzzles[loc].split(" ") + let item = this.puzzleItems[this.puzzles[loc][0]] || this.barrier_block_item - lines.forEach((l, i)=>{ - renderLibs.drawStringCentered("&0&l" + l, x*scale*2+x2+this.roomWidth/2*scale*2-l.length/2*scale*2, y*scale*2+y2+this.roomWidth/3*scale*2+i*6*scale*2-((lines.length-1)*3+4)*scale*2, scale*2) - }) + // lines.forEach((l, i)=>{ + // renderLibs.drawStringCentered("&0&l" + l, x*scale*2+x2-l.length/2*scale*2, y*scale*2+y2-this.roomWidth/3*scale*2+this.roomWidth/3*scale*2+i*6*scale*2-((lines.length-1)*3+4)*scale*2, scale*2) + // }) + item.draw(x*scale*2+x2-this.roomWidth/4*scale*2, y*scale*2+y2-this.roomWidth/4*scale*2,1.5*scale) }) } @@ -189,7 +206,7 @@ class DungeonMap extends Feature { if(end !== "[✦]" && end !== "[✔]") return name = name.join(" ").trim().replace(":", "") if(name.length > 1 && !name.includes("?")){ - this.puzzlesTab.push(name) + this.puzzlesTab.push([name, end === "[✔]"]) } // console.log(name) }) @@ -337,12 +354,6 @@ class DungeonMap extends Feature { break } - // mortLocationOnMap = mortLocationOnMap*16/this.roomWidth - if(bytes[x+y*128] === 66 && bytes[(x-1)+(y)*128] === 0 && bytes[(x)+(y-1)*128] === 0){ - if(!this.puzzles[x+y*128]){ - this.puzzles[x+y*128] = "Loading" - } - } } @@ -376,6 +387,15 @@ class DungeonMap extends Feature { ] } }) + + let [tx, ty] = [x+roomWidth/2, y+roomWidth/2] + + if(bytes[tx+ty*128] === 66){ + + if(!this.puzzles[(tx)*128+ty]){ + this.puzzles[(tx)*128+ty] = ["Loading", false] + } + } } } diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 898fab6..0ac2018 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -12,7 +12,12 @@ import ToggleSetting from "../settings/settingThings/toggle"; const EntityArrow = Java.type("net.minecraft.entity.projectile.EntityArrow") const EntityBlaze = Java.type("net.minecraft.entity.monster.EntityBlaze") const AxisAlignedBB = Java.type("net.minecraft.util.AxisAlignedBB") -let translate = net.minecraft.util.StringTranslate.func_74808_a() +let translate +try{ + translate = net.minecraft.util.StringTranslate.func_74808_a() +}catch(e){ + //player doesent have translate (using english default) +} class DungeonSolvers extends Feature { constructor() { @@ -246,7 +251,7 @@ class DungeonSolvers extends Feature { this.arrows = [] this.blazes = [] World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((e) => { - if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name"))) { + if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(getSkullName())) { this.addSkull(e); } }); @@ -287,7 +292,7 @@ class DungeonSolvers extends Feature { 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(translate.func_74805_b("item.skull.char.name")))) { + } else if (!this.eMovingThing[skull.getUUID().toString()].logged && (skullE[f.isDead] || !skullE[m.getEquipmentInSlot](4) || !skullE[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(getSkullName()))) { this.eMovingThing[skull.getUUID().toString()].logged = true; this.spawnIdThing++; @@ -382,12 +387,12 @@ class DungeonSolvers extends Feature { if (xA !== this.bloodX || yA !== this.bloodY) return; } else { - if (skull.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().trim() === translate.func_74805_b("item.skull.player.name").replace("%s",Player.getName())) { + if (skull.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().trim() === getPlayerHeadName().replace("%s",Player.getName())) { this.bloodX = (skull.getX()+8) - ((skull.getX()+8) % 32); this.bloodY = (skull.getZ()+8) - ((skull.getZ()+8) % 32); this.skulls = []; World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((e) => { - if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name"))) { + if (e.getEntity()[m.getEquipmentInSlot](4) && e.getEntity()[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(getSkullName())) { this.addSkull(e); } }); @@ -495,7 +500,7 @@ class DungeonSolvers extends Feature { this.todoE.forEach((e) => { let en = new Entity(e); // console.log(en.getName()) - if (en.getName().trim() === translate.func_74805_b("item.armorStand.name") && e[m.getEquipmentInSlot](4) && e[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(translate.func_74805_b("item.skull.char.name"))) { + if (en.getName().trim() === getArmorStandName() && e[m.getEquipmentInSlot](4) && e[m.getEquipmentInSlot](4)[m.getDisplayName.ItemStack]().endsWith(getSkullName())) { this.addSkull(en); } }); @@ -539,3 +544,27 @@ class DungeonSolvers extends Feature { module.exports = { class: new DungeonSolvers(), }; + + +function getSkullName(){ + if(translate){ + return translate.func_74805_b("item.skull.char.name") + } + + return "Head" +} + +function getPlayerHeadName(){ + if(translate){ + return translate.func_74805_b("item.skull.player.name") + } + + return "%s's Head" +} +function getArmorStandName(){ + if(translate){ + return translate.func_74805_b("item.armorStand.name") + } + + return "Armor Stand" +}
\ No newline at end of file diff --git a/features/hud/index.js b/features/hud/index.js index 8bdab52..d830104 100644 --- a/features/hud/index.js +++ b/features/hud/index.js @@ -563,7 +563,7 @@ class Hud extends Feature { string = "&6Deaths&7> &f" + this.numberUtils.numberWithCommas(this.lastStatData.death_count) } if(type === "cata"){ - let cataData = getLevelByXp(this.lastStatData.dungeons.dungeon_types.catacombs.experience, 2, 50) + let cataData = getLevelByXp(this.lastStatData.dungeons.dungeon_types.catacombs.experience, 2, Infinity) string = "&6Cata&7> &f" + (~~((cataData.level+cataData.progress)*100)/100).toFixed(2) + " &7(" + this.numberUtils.numberWithCommas(cataData.xpCurrent) + (cataData.level===50?"":"/" + this.numberUtils.numberWithCommas(cataData.xpForNext)) + ")" } |