This commit is contained in:
2026-09-24 23:28:01 -03:00
parent 79faa556de
commit bb42dd662e
73 changed files with 2349 additions and 34 deletions
+8
View File
@@ -48,6 +48,12 @@ export class EverythingRegistry {
static get_registry<T>(registry: string): T[] {
return this.#id_to_value.get(registry) as T[];
}
// [key, value] pairs in registration order
static entries<T>(registry: string): [string, T][] {
const values = this.#id_to_value.get(registry) ?? [];
return [...(this.#key_to_id.get(registry) ?? [])].map(([key, id]) => [key, values[id] as T]);
}
}
interface TextureSideTopBottom {
@@ -96,6 +102,8 @@ export interface BlockRegistry {
// right clicking it does something instead of placing a block, clients don't predict placing against it.
// behavior runs on the server, see server/game/blocks.ts
interactive?: boolean;
// placing a block into it replaces it, like water
replaceable?: boolean;
compiled_states?: CompiledStateDefinition[];
}