Single module modding

This commit is contained in:
2026-11-14 12:18:41 -03:00
parent 605008f584
commit 313098892e
134 changed files with 919 additions and 924 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ const half_shaft = (facing: Face) => HALF_SHAFT_TURNS[OPPOSITE[facing]];
// how a model made along y is turned to an axis, the way the kinetic blocks' variants turn theirs
const AXIS_TURNS: Record<Axis, { x?: number; y?: number }> = { x: { x: 90, y: 90 }, y: {}, z: { x: 90, y: 180 } };
export function setup(ctx: ClientContext) {
export function client(ctx: ClientContext) {
const shape_of = (block: VisualBlock): KineticShape => {
const params = ctx.blocks.components(block.id)["create:kinetic"] as KineticParams;
return kinetic_shape(params, (name) => block.states[name]);
+7
View File
@@ -0,0 +1,7 @@
// SPDX-FileCopyrightText: 2026 Paula Wisnievski
// SPDX-License-Identifier: AGPL-3.0-or-later
// create's script. each phase is in its own file, see docs/modding/concepts/sides.md
export { shared } from "./shared.ts";
export { server } from "./server.ts";
export { client } from "./client.ts";
+1 -1
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// create's processing recipes, the shape its machines' recipe types share, like ProcessingRecipe: item choices in, and
// stacks out, each with a chance, and for the types that can, fluids out as { fluid, amount }. the shared script
// stacks out, each with a chance, and for the types that can, fluids out as { fluid, amount }. the shared phase
// registers each type, so a broken recipe stops the mod loading instead of a machine later. no ctx, tests give what it
// needs
import type { FluidStack, Id, RecipeType } from "cubi/shared";
+1 -1
View File
@@ -79,7 +79,7 @@ interface PressData extends KineticData {
scan?: number;
}
export function setup(ctx: ServerContext) {
export function server(ctx: ServerContext) {
const config: Config = ctx.config;
const world = kinetic_world(ctx, config);
+1 -1
View File
@@ -20,7 +20,7 @@ import {
OPPOSITE,
} from "./kinetics/connections.ts";
export function setup(ctx: SharedContext) {
export function shared(ctx: SharedContext) {
const lookup = { expand: ctx.tags.expand, item_exists: ctx.items.exists, fluid_exists: ctx.fluids.exists };
ctx.recipes.register_type(PRESSING.id, processing_type(PRESSING, lookup));
ctx.recipes.register_type(COMPACTING.id, processing_type(COMPACTING, lookup));