diff options
-rw-r--r-- | featureClass/featureManager.js | 2 | ||||
-rw-r--r-- | features/dungeonMap/index.js | 48 | ||||
-rw-r--r-- | features/dungeonSolvers/index.js | 41 | ||||
-rw-r--r-- | features/hud/index.js | 2 | ||||
-rw-r--r-- | utils/statUtils.js | 18 |
5 files changed, 87 insertions, 24 deletions
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js index 2502b02..4d3c616 100644 --- a/featureClass/featureManager.js +++ b/featureClass/featureManager.js @@ -371,7 +371,7 @@ class FeatureManager { let event = this.registerCustom("command", func, context) - event.trigger.setName(commandName) + event.trigger.setName(commandName, true) return event } 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)) + ")" } diff --git a/utils/statUtils.js b/utils/statUtils.js index fd41110..ae064cf 100644 --- a/utils/statUtils.js +++ b/utils/statUtils.js @@ -274,6 +274,20 @@ function getLevelByXp(xp, type, levelCap) { let progress = Math.max(0, Math.min(xpCurrent / xpForNext, 1)); + + if (type === 2 && level === 50) { + while (level < levelCap && xpCurrent > 200000000) { + level++ + xpCurrent -= 200000000 + } + if(level < levelCap){ + progress = xpCurrent / 200000000 + xpForNext = 200000000 + }else{ + progress = 0 + xpForNext = NaN + } + } return { xp, level, @@ -311,8 +325,8 @@ function getSlayerLevelClaimed(slayer) { return level; } -function getDungeoneeringLevel(xp) { - let a = getLevelByXp(xp, 2, 50); +function getDungeoneeringLevel(xp, isCata) { + let a = getLevelByXp(xp, 2, isCata ? Infinity : 50); return a.level + a.progress; } |