Facility door

This commit is contained in:
2026-11-15 21:55:17 -03:00
parent 7435a6bb7c
commit be0770f3cf
12 changed files with 318 additions and 3 deletions
+1 -1
View File
@@ -627,7 +627,7 @@ export interface BlockApi {
// how long breaking it by hand takes without a tool, in seconds, from the block's mining. Infinity for one that
// can't be broken. for machines that break blocks, like a drill
toughness(id: Id): number;
// the components its json lists and their params, a copy, like ItemApi.components
// the components its json lists and their params, a copy, like ItemApi.components. air has none
components(id: Id): Record<Id, unknown>;
// whether it's solid like stone: drawn in the solid layer, and a whole block to bump into in every state. glass,
// leaves, slabs and chests aren't. what passes signals on, and what wire turns corners around. false for air
+1 -1
View File
@@ -61,7 +61,7 @@ export function blocks_api(): SharedContext["blocks"] {
};
return {
exists: (id) => EverythingRegistry.get("blocks", id) !== undefined,
components: (id) => structuredClone(known(id).components ?? {}),
components: (id) => id === AIR_ID ? {} : structuredClone(known(id).components ?? {}),
solid: (id) => id !== AIR_ID && is_solid(known(id)),
};
}