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
@@ -9,14 +9,37 @@
"model": "dangerous_business:double_steel_pipes",
"item_model": "dangerous_business:double_steel_pipes",
"shape": [[0, 0, 4.5, 16, 16, 11.5]],
"components": {
"dangerous_business:pipe": {}
},
"states": [
{
"name": "facing",
"bits": 2,
"default": 0
},
{
"name": "horizontal",
"bits": 1,
"default": 0
}
],
"variants": {
"horizontal=1,facing=0": {
"x": 90
},
"horizontal=1,facing=1": {
"x": 90,
"y": 90
},
"horizontal=1,facing=2": {
"x": 90,
"y": 180
},
"horizontal=1,facing=3": {
"x": 90,
"y": 270
},
"facing=0": {
"y": 180
},
+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) {