Double steel pipes model

This commit is contained in:
2026-11-17 08:20:29 -03:00
parent 1b06fa29e1
commit 8230fe297d
3 changed files with 54 additions and 2 deletions
+12
View File
@@ -11,6 +11,7 @@ export function shared(ctx: SharedContext) {
register_door(ctx);
register_facility_door(ctx);
register_half(ctx);
register_pipe(ctx);
register_connects(ctx);
register_random_look(ctx);
}
@@ -28,6 +29,17 @@ function register_half(ctx: SharedContext) {
});
}
// stands up when placed against the top or bottom of a block, and lies along the way it was placed (horizontal 1, facing
// that way) against a side, so a run of them can go up walls and along them
function register_pipe(ctx: SharedContext) {
ctx.components.register_block("dangerous_business:pipe", {
state_for_placement(placement): Record<string, number> {
if (placement.face === "top" || placement.face === "bottom") return { horizontal: 0 };
return { horizontal: 1, facing: FACINGS.indexOf(placement.face) };
},
});
}
// sets its north, east, south and west states (and top, with "up") to 1 where the same block is beside it, so it can
// hide its edges there, like floor grates joining into one floor
function register_connects(ctx: SharedContext) {