fix(stage-tamagotchi): fix window visibility and ozone flags on wayland (#2288)

This commit is contained in:
이윤진(Lee Yunjin)
2026-08-27 17:25:06 +08:00
committed by GitHub
parent c86894ccdc
commit 62b4fd21ff
17 changed files with 330 additions and 45 deletions
@@ -98,6 +98,13 @@ export async function placeBlock(
west: new Vec3(-1, 0, 0),
}
// Fallback search priority when the requested face is unavailable. Kept as an
// explicit array because the first fallback decides which face the bot attaches
// to, which can change the placed block's orientation; relying on
// `Object.values(dirMap)` would silently change this priority if the dirMap
// keys are ever reordered (e.g. by sorting).
const fallbackDirs = [dirMap.top, dirMap.bottom, dirMap.north, dirMap.south, dirMap.east, dirMap.west]
const dirs: Vec3[] = []
if (placeOn === 'side') {
dirs.push(dirMap.north, dirMap.south, dirMap.east, dirMap.west)
@@ -111,7 +118,7 @@ export async function placeBlock(
}
// Add remaining directions
dirs.push(...Object.values(dirMap).filter(d => !dirs.includes(d)))
dirs.push(...fallbackDirs.filter(d => !dirs.includes(d)))
let buildOffBlock: Block | null = null
let faceVec: Vec3 | null = null
+8 -1
View File
@@ -287,6 +287,13 @@ function findPlacementSpot(mineflayer: Mineflayer, targetDest: Vec3, placeOn: Bl
}
function getPlacementDirections(placeOn: BlockFace, dirMap: Record<string, Vec3>): Vec3[] {
// Fallback search priority when the requested face is unavailable. Kept as an
// explicit array because the first fallback decides which face the bot attaches
// to, which can change the placed block's orientation; relying on
// `Object.values(dirMap)` would silently change this priority if the dirMap
// keys are ever reordered (e.g. by sorting).
const fallbackDirs = [dirMap.top, dirMap.bottom, dirMap.north, dirMap.south, dirMap.east, dirMap.west]
const directions: Vec3[] = []
if (placeOn === 'side') {
directions.push(dirMap.north, dirMap.south, dirMap.east, dirMap.west)
@@ -298,7 +305,7 @@ function getPlacementDirections(placeOn: BlockFace, dirMap: Record<string, Vec3>
directions.push(dirMap.bottom)
}
directions.push(...Object.values(dirMap).filter(d => !directions.includes(d)))
directions.push(...fallbackDirs.filter(d => !directions.includes(d)))
return directions
}