fix(lobby,easter-egg): update portal coordinates and egg-check ring
Lobby portal zones and signs moved to the rebuilt portal area at ~(436..488, 65..74, -322..-281), including a second Lyla's-World "Super Kitties" portal. Signs now use per-portal facing_direction so they face the hub walkway correctly. Easter-egg placeAllEggs validation now samples the far-ring eggs (indices 45-49) before falling back to the near ring — avoids false "blocks missing" reports when only close-ring eggs have been picked up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -240,8 +240,14 @@ function placeAllEggs(playerPos) {
|
|||||||
// Validate at least one stored egg block actually exists
|
// Validate at least one stored egg block actually exists
|
||||||
const stored = getEggPositions();
|
const stored = getEggPositions();
|
||||||
if (stored && stored.length > 0) {
|
if (stored && stored.length > 0) {
|
||||||
|
// Check far-ring eggs (last 5) — they're hardest to reach and least likely
|
||||||
|
// to have been collected yet. Avoids false "blocks missing" detection when
|
||||||
|
// only the close-ring eggs (1-5) have been collected.
|
||||||
let found = 0;
|
let found = 0;
|
||||||
for (let i = 0; i < Math.min(5, stored.length); i++) {
|
const checkAt = [45, 46, 47, 48, 49].filter(i => i < stored.length);
|
||||||
|
const fallback = checkAt.length === 0;
|
||||||
|
const indices = fallback ? [0, 1, 2, 3, 4].filter(i => i < stored.length) : checkAt;
|
||||||
|
for (const i of indices) {
|
||||||
try {
|
try {
|
||||||
const block = overworld.getBlock({ x: stored[i].x, y: stored[i].y, z: stored[i].z });
|
const block = overworld.getBlock({ x: stored[i].x, y: stored[i].y, z: stored[i].z });
|
||||||
if (block && block.typeId.includes("glazed_terracotta")) found++;
|
if (block && block.typeId.includes("glazed_terracotta")) found++;
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ const PORTAL_BLOCKS = {
|
|||||||
|
|
||||||
// Coordinate-based portal zones (fallback detection)
|
// Coordinate-based portal zones (fallback detection)
|
||||||
const PORTAL_ZONES = [
|
const PORTAL_ZONES = [
|
||||||
{ name: "Jamie's World", x: -15, y: 65, z: -24, host: "10.0.0.247", port: 19133, color: "§a" },
|
{ name: "Jamie's World", x: 436, y: 66, z: -296, host: "10.0.0.247", port: 19133, color: "§a" },
|
||||||
{ name: "Lyla's World", x: 0, y: 65, z: -24, host: "10.0.0.247", port: 19134, color: "§d" },
|
{ name: "Lyla's World", x: 462, y: 65, z: -322, host: "10.0.0.247", port: 19134, color: "§d" },
|
||||||
{ name: "Mya's World", x: 15, y: 65, z: -24, host: "10.0.0.247", port: 19135, color: "§b" },
|
{ name: "Lyla's World", x: 474, y: 65, z: -281, host: "10.0.0.247", port: 19134, color: "§d" }, // Super Kitties portal
|
||||||
|
{ name: "Mya's World", x: 488, y: 66, z: -296, host: "10.0.0.247", port: 19135, color: "§b" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const PORTAL_RADIUS_X = 2.5;
|
const PORTAL_RADIUS_X = 2.5;
|
||||||
@@ -114,14 +115,15 @@ world.afterEvents.playerLeave.subscribe((event) => {
|
|||||||
function placePortalSigns() {
|
function placePortalSigns() {
|
||||||
const overworld = world.getDimension("overworld");
|
const overworld = world.getDimension("overworld");
|
||||||
const signs = [
|
const signs = [
|
||||||
{ x: -15, y: 70, z: -23, name: "Jamie's", color: "§a" },
|
{ x: 438, y: 71, z: -296, name: "Jamie's", color: "§a", facing: 5 }, // east-facing
|
||||||
{ x: 0, y: 70, z: -23, name: "Lyla's", color: "§d" },
|
{ x: 462, y: 71, z: -320, name: "Lyla's", color: "§d", facing: 3 }, // south-facing
|
||||||
{ x: 15, y: 70, z: -23, name: "Mya's", color: "§b" },
|
{ x: 486, y: 71, z: -296, name: "Mya's", color: "§b", facing: 4 }, // west-facing
|
||||||
|
{ x: 474, y: 74, z: -281, name: "Super Kitties\n§fLyla's", color: "§d", facing: 2 }, // north-facing (Super Kitties portal)
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const sign of signs) {
|
for (const sign of signs) {
|
||||||
try {
|
try {
|
||||||
overworld.runCommand(`setblock ${sign.x} ${sign.y} ${sign.z} oak_wall_sign ["facing_direction":3]`);
|
overworld.runCommand(`setblock ${sign.x} ${sign.y} ${sign.z} oak_wall_sign ["facing_direction":${sign.facing}]`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Non-fatal — chunks may not be loaded
|
// Non-fatal — chunks may not be loaded
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user