Skip to content

Commit

Permalink
v2.9.2 final
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenga8533 committed Apr 18, 2024
1 parent 1258ebc commit 0913b9a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 2 additions & 0 deletions changelog.json
Expand Up @@ -2,12 +2,14 @@
"- Added Hoppity event experimental features",
"- Added widget display (`/va wgl`)",
"- Added `/missingSkins`",
"- Added corpse waypoints",
"- Compacted some chat messages to be 1 message",
"- Changed fossil finder to the worst Leetcode algorithm",
"- Changed chat waypoints to detect item",
"- Changed searchbar highlighting to be more obvious",
"- Fixed new Gemstone in value calc",
"- Fixed `/resetSkills`",
"- Fixed searchbar calculator showing NaN",
"- Fixed powder tracker timer",
"- Removed bestiary display (`/va wgl add bestiary`)"
]
4 changes: 2 additions & 2 deletions features/mining/FossilHelper.js
Expand Up @@ -219,7 +219,7 @@ const highlightTile = register("guiRender", () => {
}).unregister();

const trackClicks = register("guiMouseClick", () => {
Client.scheduleTask(3, () => {
Client.scheduleTask(1, () => {
const container = Player.getContainer().getItems();
const fossil = container.find(item => item?.getName() === "§6Fossil");

Expand Down Expand Up @@ -264,7 +264,7 @@ const untrackFossils = register("guiClosed", () => {
}).unregister();

registerWhen(register("guiOpened", () => {
Client.scheduleTask(3, () => {
Client.scheduleTask(1, () => {
const container = Player.getContainer();
if (container.getName() !== "Fossil Excavator" || container.getItems()[49].getName() === "§cClose") return;
highlightTile.register();
Expand Down
14 changes: 5 additions & 9 deletions features/mining/ShaftAnnounce.js
Expand Up @@ -19,7 +19,7 @@ const TRANSFER_COMMANDS = ["?transfer", "!ptme", "!pt", ".transfer", "Mineshaft,
*/
function attemptTransfer(index) {
delay(() => {
if (getIsLeader() || index > 4) return;
if (getIsLeader() || index >= TRANSFER_COMMANDS.length) return;
ChatLib.command(`pc ${TRANSFER_COMMANDS[index]}`);
attemptTransfer(index + 1);
}, 420);
Expand Down Expand Up @@ -92,12 +92,6 @@ registerWhen(register("chat", (_, x, y, z) => {
corpses.push([x, y, z.split(' ')[0]]);
}).setCriteria("${player}: x: ${x}, y: ${y}, z: ${z}"), () => settings.corpseAnnounce && getWorld() === "Mineshaft");

register("worldUnload", () => {
corpses = [];
looted = [];
});


/**
* Corpse detection
*/
Expand Down Expand Up @@ -127,9 +121,9 @@ registerWhen(register("step", () => {
stands.forEach(stand => {
const helmet = stand.getEntity()?.func_71124_b(4); // getEquipmentInSlot(0: Tool in Hand; 1-4: Armor)
if (helmet !== null) {
const type = helmet.func_82833_r().removeFormatting().split(' ')[0]; // getDisplayName
const type = helmet.func_82833_r().removeFormatting().split(' ')[0]; // getDisplayName for ItemStack
if (!(type in corpseWaypoints)) return;

const corpsePos = [ARMOR_MATCH[type], stand.getX(), stand.getY() + 2, stand.getZ()];
if (getClosest(corpsePos, looted)[1] < 10) return;
corpseWaypoints[type].push([ARMOR_MATCH[type], stand.getX(), stand.getY() + 2, stand.getZ()]);
Expand All @@ -138,6 +132,8 @@ registerWhen(register("step", () => {
}).setDelay(1), () => settings.corpseWaypoints && getWorld() === "Mineshaft");

register("worldUnload", () => {
corpses = [];
looted = [];
corpseWaypoints = {
"Lapis": [],
"Mineral": [],
Expand Down
1 change: 1 addition & 0 deletions utils/variables.js
Expand Up @@ -156,6 +156,7 @@ export function registerWhen(trigger, dependency) {

// Updates trigger registrations based on world or GUI changes
export function setRegisters(off = false) {
Client.showTitle("Loading...", "", 0, 1 ,0);
registers.forEach(trigger => {
if (off || (!trigger[1]() && trigger[2])) {
trigger[0].unregister();
Expand Down

0 comments on commit 0913b9a

Please sign in to comment.