Every recipe type registered from shared scripts

This commit is contained in:
2026-11-03 15:34:41 -03:00
committed by paula
parent 65113862f7
commit b329a61d96
25 changed files with 334 additions and 371 deletions
+5 -1
View File
@@ -48,7 +48,7 @@ export class FluidRules {
api(): FluidApi {
return {
ids: () => EverythingRegistry.entries("fluids").map(([id]) => id),
exists: (id) => EverythingRegistry.get("fluids", id) !== undefined,
exists: fluid_exists,
name: (fluid) => this.name(fluid),
color: (fluid) => this.color(fluid),
same: same_fluid,
@@ -68,6 +68,10 @@ export class FluidRules {
}
}
export function fluid_exists(id: string): boolean {
return EverythingRegistry.get("fluids", id) !== undefined;
}
// whether they're one fluid, see FluidApi.same
export function same_fluid(a: FluidVariant, b: FluidVariant): boolean {
return a.id === b.id && same_data(a.data, b.data);