fix(hub-return): recover the uncommitted 1.0.9 from the NAS archive
Deploy Addons / deploy (push) Failing after 0s
Deploy Addons / deploy (push) Failing after 0s
hub-return existed on the host at 1.0.9 but had never been committed; main
only had 1.0.5. The deploy workflow's `git checkout -f origin/main -- $PATHS`
reverted the host to 1.0.5, discarding work that existed nowhere in git.
Recovered verbatim from the 2026-06-03 NAS archive. The RP is byte-identical
between the two, and the file sets match, so this is only the BP manifest
version plus scripts/main.js.
What 1.0.9 adds over 1.0.5:
* a spawn tip pointing players at private chests, since break-protection
covers chests but not terrain
* Family Goals integration -- a "Family" button in the hub menu, shown only
when the family-goals addon is present (sniffed via its world dynamic
property), dispatching `scriptevent family:menu` as the player so
family-goals sees the right sourceEntity
That integration pairs with family-goals, which was itself uncommitted until
this branch, so the two were lost and recovered together.
All three child worlds re-pinned to [1,0,9] (jamie already expected it; lyla
and mya were on 1.0.5) and verified loading at 1.0.9 in the pack stack.
Carried over as-is rather than tidied: openHubMenu still emits a
`[Hub][diag]` console.warn on every open, left from mid-development. Worth
removing, but not while recovering -- recovery should be faithful.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Gf1kZypRDfPL1YiWUS1LC
This commit is contained in:
co-authored by
Claude Opus 5
parent
50af20981f
commit
cde6c46bf2
@@ -4,7 +4,7 @@
|
||||
"name": "Hub Return Transfer",
|
||||
"description": "Transfers players back to lobby when they step on the return portal",
|
||||
"uuid": "b2c3d4e5-1111-2222-3333-fedcba654321",
|
||||
"version": [1, 0, 5],
|
||||
"version": [1, 0, 9],
|
||||
"min_engine_version": [1, 21, 0]
|
||||
},
|
||||
"modules": [
|
||||
@@ -12,7 +12,7 @@
|
||||
"type": "script",
|
||||
"language": "javascript",
|
||||
"uuid": "b2c3d4e5-4444-5555-6666-fedcba987654",
|
||||
"version": [1, 0, 5],
|
||||
"version": [1, 0, 9],
|
||||
"entry": "scripts/main.js"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -190,6 +190,8 @@ world.afterEvents.playerSpawn.subscribe((event) => {
|
||||
player.runCommand(`titleraw @s title {"rawtext":[{"text":"§6Welcome!"}]}`);
|
||||
player.runCommand(`titleraw @s subtitle {"rawtext":[{"text":"§7You are now in §e${WORLD_NAME}"}]}`);
|
||||
giveCompassIfMissing(player);
|
||||
// Light social reminder — break-protection only covers chests, not terrain.
|
||||
player.sendMessage("§7[Tip] §fUse a §dprivate chest§f for valuables — break-protection only covers chests.");
|
||||
} catch (e) {
|
||||
// Player may have disconnected
|
||||
}
|
||||
@@ -244,6 +246,27 @@ async function openCompassMenu(player) {
|
||||
form.button("\uD83E\uDDED Get a marker block");
|
||||
actions.push({ kind: "give_marker" });
|
||||
|
||||
// Family Goals integration — only surfaces if the family-goals addon is loaded
|
||||
// in this world. We sniff its world dynamic property; absence = silent skip.
|
||||
let familyLoaded = false;
|
||||
let famDebug = "?";
|
||||
let idsList = "?";
|
||||
try {
|
||||
const v = world.getDynamicProperty("family_goals_v1");
|
||||
famDebug = `${typeof v}:${v === undefined ? "undef" : String(v).slice(0, 30)}`;
|
||||
familyLoaded = v !== undefined;
|
||||
if (typeof world.getDynamicPropertyIds === "function") {
|
||||
idsList = world.getDynamicPropertyIds().join(",");
|
||||
} else {
|
||||
idsList = "(getDynamicPropertyIds missing)";
|
||||
}
|
||||
} catch (e) { famDebug = `err:${e.message}`; }
|
||||
console.warn(`[Hub][diag] familyLoaded=${familyLoaded} probe=${famDebug} ids=${idsList}`);
|
||||
if (familyLoaded) {
|
||||
form.button("\uD83C\uDFC6 Family");
|
||||
actions.push({ kind: "family_menu" });
|
||||
}
|
||||
|
||||
form.button("§7Cancel");
|
||||
actions.push({ kind: "cancel" });
|
||||
|
||||
@@ -282,6 +305,14 @@ async function openCompassMenu(player) {
|
||||
giveMarkerBlock(player);
|
||||
return;
|
||||
}
|
||||
if (a.kind === "family_menu") {
|
||||
// Hand off to family-goals addon. The scriptevent is dispatched as the
|
||||
// player so family-goals' subscriber sees event.sourceEntity = this player.
|
||||
try { player.runCommand("scriptevent family:menu"); } catch (e) {
|
||||
player.sendMessage(`§c[Hub] Couldn't open Family menu: ${e.message}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function giveMarkerBlock(player) {
|
||||
|
||||
Reference in New Issue
Block a user