diff --git a/features/Diana/DianaMobDetect.js b/features/Diana/DianaMobDetect.js index 0e19ecf..dc97502 100644 --- a/features/Diana/DianaMobDetect.js +++ b/features/Diana/DianaMobDetect.js @@ -5,7 +5,7 @@ import { mythosMobHpOverlay } from "../guis/DianaGuis"; import { checkDiana } from "../../utils/checkDiana"; import RenderLibV2 from "../../../RenderLibV2"; import { data } from "../../utils/variables"; -import { checkSendInqMsg } from "../../utils/functions"; +import {checkSendInqMsg, hasTrackedInq} from "../../utils/functions"; export function getMobsToDisplay() { return names; } @@ -102,17 +102,42 @@ registerWhen(register("step", () => { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((armorStand) => { let uuid = armorStand.getUUID(); seenUUIDs.add(uuid); - + checkCocoon(armorStand); + trackEntity(uuid, armorStand, TrackedInqs, (name) => name.includes("Inquisitor"), dianaEntityList); trackEntity(uuid, armorStand, TrackedMobs, (name) => (name.includes("Exalted") || name.includes("Stalwart")) && !name.split(" ")[2].startsWith("0"), dianaEntityList, true); }); - updateTrackedEntities(TrackedInqs, seenUUIDs); updateTrackedEntities(TrackedMobs, seenUUIDs); } }).setFps(6), () => settings.mythosMobHp || settings.inqHighlight || settings.inqCircle && getWorld() === "Hub"); +const cocoonTexture = "eyJ0aW1lc3RhbXAiOjE1ODMxMjMyODkwNTMsInByb2ZpbGVJZCI6IjkxZjA0ZmU5MGYzNjQzYjU4ZjIwZTMzNzVmODZkMzllIiwicHJvZmlsZU5hbWUiOiJTdG9ybVN0b3JteSIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGNlYjBlZDhmYzIyNzJiM2QzZDgyMDY3NmQ1MmEzOGU3YjJlOGRhOGM2ODdhMjMzZTBkYWJhYTE2YzBlOTZkZiJ9fX0=" +let lastCocoonCheck = 0; +export function checkCocoon(armorstand) { + + if (!settings.cocoonShare && !settings.cocoonTitle) return false; + let armor = armorstand?.entity?.func_82169_q(3) + if (!armor) return false; + let skull = new Item(armor) + if (skull.getID() !== 397) return false; + let nbtObject = skull.getItemNBT()?.toObject(); + if (!nbtObject) return false; + let texture = nbtObject.tag?.SkullOwner?.Properties?.textures?.[0]?.Value; + if (!texture) return false; + if (lastCocoonCheck + 10000 < Date.now()) { + if (settings.cocoonShare) { + ChatLib.command("pc Cocoon") + } + if (settings.cocoonTitle) { + Client.showTitle(`&r&6&l<&b&l&kO&6&l> &b&lINQUISITOR! &6&l<&b&l&kO&6&l>`, "", 0, 40, 20); + } + lastCocoonCheck = Date.now(); + } + return texture === cocoonTexture +} + let inqs = []; export const inqHighlightRegister = register("renderWorld", () => { inqs = []; diff --git a/features/general/PartyCommands.js b/features/general/PartyCommands.js index 093353c..c3b4787 100644 --- a/features/general/PartyCommands.js +++ b/features/general/PartyCommands.js @@ -235,6 +235,7 @@ register("chat", (player, message) => { ChatLib.command("pc Coins: " + formatNumber(dianaTrackerMayor["items"]["coins"])) }, 200) } + break case "!mob": case "!mobs": if (settings.dianaTracker && settings.dianaPartyCommands) { diff --git a/index.js b/index.js index 7f780ed..d16fb25 100644 --- a/index.js +++ b/index.js @@ -49,15 +49,7 @@ const commands = [ ]; const changelog = [ - {header: "Added", description: "new setting to change the waypoint text size"}, - {header: "Added", description: "new party command !totalstats "}, - {header: "Added", description: "new secret achievement"}, - {header: "Added", description: "new setting to disable the castle warp if needed"}, - {header: "Changed", description: "a setting that added warps to the guess warp (make sure the warps you use are enabled in the settings)"}, - {header: "Changed", description: "The way waypoints are rendered"}, - {header: "Changed", description: "some required modules to different ones to reduce the amount of modules required"}, - {header: "removed", description: "1 unused setting"}, - {header: "removed", description: "kuudra attribute value overlay (cause hypixel reworked attributes)"}, + {header: "Added", description: "Added Cocoon detection to Inquisitor deaths"}, ]; register("command", (args1, ...args) => { @@ -85,7 +77,7 @@ register("worldLoad", () => { Client.showTitle("", "", 0, 40, 20); }); -const newVersion = "1.0.0" // hier neue version eintragen wenn changelog angezeigt werden soll; +const newVersion = "1.0.1" // hier neue version eintragen wenn changelog angezeigt werden soll; const downloadMsgReg = register("step", () => { if (!World.isLoaded()) return if (!isDataLoaded()) return diff --git a/metadata.json b/metadata.json index fb6c14f..42cf89a 100644 --- a/metadata.json +++ b/metadata.json @@ -2,7 +2,7 @@ "name": "SBO", "creator": "RolexDE, D4rkswift", "description": "SBO is the ultimate diana mod for diana nons! FPS friendly, and packed with QOL features!", - "version": "1.0.0", + "version": "1.0.1", "entry": "index.js", "requires": [ "Vigilance", diff --git a/settings.js b/settings.js index 9a58c6b..fbdb290 100644 --- a/settings.js +++ b/settings.js @@ -313,6 +313,20 @@ class Settings { subcategory: "Other", }) inquisDetect = true; + @SwitchProperty({ + name: "Share Inq Cocoon", + description: "Sends a text on inq cocoon", + category: "Diana", + subcategory: "Other", + }) + cocoonShare = true; + @SwitchProperty({ + name: 'Show Title On Inq Cocoon', + description: 'Shows a title on inq cocoon', + category: "Diana", + subcategory: "Other", + }) + cocoonTitle = false; @SwitchProperty({ name: "Copy Inquisitor Coords", description: "Copy coords for inquisitors (patcher format) mainly for muted player.", diff --git a/utils/functions.js b/utils/functions.js index f6447a9..93554c5 100644 --- a/utils/functions.js +++ b/utils/functions.js @@ -192,7 +192,7 @@ function trackLsInq(tracker) { } tracker.save(); } -let hasTrackedInq = false; +export let hasTrackedInq = false; registerWhen(register("entityDeath", (entity) => { // geht noch nicht weil er real enitiy names mint wie ZOMBIE, Iron Golem etc let dist = entity.distanceTo(Player.getPlayer()); entityName = entity.getName().toString();