Worm bin model
This commit is contained in:
@@ -29,7 +29,7 @@ export interface ModelElementJson {
|
||||
rotation?: {
|
||||
origin: [number, number, number];
|
||||
axis: "x" | "y" | "z";
|
||||
// -45, -22.5, 0, 22.5 or 45
|
||||
// degrees, any from -180 to 180. minecraft only takes -45, -22.5, 0, 22.5 or 45, blockbench's newer models any
|
||||
angle: number;
|
||||
// stretch the rotated faces back to the block's size, like the cross model does
|
||||
rescale?: boolean;
|
||||
|
||||
+2
-2
@@ -808,10 +808,10 @@ export function validate_model(json: unknown): Problems {
|
||||
if (rotation !== undefined) {
|
||||
if (
|
||||
!is_object(rotation) || !["x", "y", "z"].includes(rotation.axis as string) ||
|
||||
![-45, -22.5, 0, 22.5, 45].includes(rotation.angle as number) || !Array.isArray(rotation.origin)
|
||||
typeof rotation.angle !== "number" || Math.abs(rotation.angle) > 180 || !Array.isArray(rotation.origin)
|
||||
) {
|
||||
problems.push(
|
||||
`${where}.rotation must be { origin, axis: x, y or z, angle: -45, -22.5, 0, 22.5 or 45 }`,
|
||||
`${where}.rotation must be { origin, axis: x, y or z, angle: degrees from -180 to 180 }`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user