diff --git a/Standards/CCSMB-15.md b/Standards/CCSMB-15.md new file mode 100644 index 0000000..50d1cf2 --- /dev/null +++ b/Standards/CCSMB-15.md @@ -0,0 +1,60 @@ +# _CCSMB-15_: Wide Printer Format and Wide Printer Format Array + +_Author: znepb_ +_Version_: 1.0.0 +_Last revised:_ +The words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are defined in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119). + +## Rationale + +Wide Printer Format (2dj) is a file format used by [SwitchCraft Peripherals](https://github.com/SwitchCraftCC/sc-peripherals) to print poster files. These files contain information to print onto these posters, each pixel being a different color similar to map files. Wide Format Print (A) (2dja), is similar to 2dj. + +## 2dj + +### Format + +| Information | | +| ----------- | ------------------- | +| Version | 1.0.0 | +| Type | Wide Printer Format | +| MIME | `image/2dj` | +| Extensions | `.2dj` | + +Wide Printer Format files MUST follow [RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259), "The JavaScript Object Notation (JSON) Data Interchange Format." These files MUST also use the file extension `.2dj`. The file MUST contain an object, with keys and values specified below. + +### Keys + +- `label`: This key SHOULD contain the name of the poster. It MUST be a string. +- `tooltip`: This key MAY contain a tooltip displayed while hovering over the poster in the players inventory. It MUST be a string. +- `palette`: MUST be `null` or an array and MUST NOT have more than 63 values. This defines the color palette the poster will use. + - Each value MUST be a hexadecimal value between `0x000000` (0) and `0xFFFFFF` (16777215) + - In the event that this key is not provided, the printer MUST follow the [default Minecraft colors for maps.](https://minecraft.wiki/w/Map_item_format#Base_colors) + - Index zero MUST NOT be included. This is reserved for the transparent color. +- `pixels`: MUST be an array of length 16384. Each value MUST be between zero (0) and sixty-three (63). + - Each value MUST correspond to its value in the index of palette. For example, if the value is 2, and index 2 of `palette` is `0xff0000`, that color MUST be red. +- `width` and `height`: MAY be included, if included its value MUST be the number `128`. + +## 2dja + +| Information | | +| ----------- | ------------------------- | +| Version | 1.0.0 | +| Type | Wide Printer Format Array | +| MIME | `image/2dja` | +| Extensions | `.2dja` | + +### Format + +Wide Printer Format Array files MUST follow [RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259), "The JavaScript Object Notation (JSON) Data Interchange Format." These files MUST also use the file extension `.2dja`. The file MUST contain an object, with keys and values specified below. + +### Keys + +- `title`: This key SHOULD contain the title of the poster array. It MUST be a string. +- `width`: This key SHOUlD be included, and if included, MUST be the width of the poster array. It MUST be a number. +- `height`: This key SHOULD be the height, and if included, MUST be the poster array. It MUST be a number. +- `pages`: MUST be an array of 2dj files. + +## References + +- https://docs.sc3.io/features/sc-peripherals.html#_2dja-format +- https://docs.sc3.io/features/sc-peripherals.html#_2dja-format diff --git a/Standards/CCSMB-16.md b/Standards/CCSMB-16.md new file mode 100644 index 0000000..dd65a4c --- /dev/null +++ b/Standards/CCSMB-16.md @@ -0,0 +1,62 @@ +# _CCSMB-16_: 3D Print JSON + +_Author: znepb_ +_Version_: 1.0.0 +_Last revised:_ +The words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are defined in [RFC 2119](https://www.rfc-editor.org/rfc/rfc2119). + +## Rational + +3D Print JSON Storage (3dj) is a file format used by [SwitchCraft peripherals](https://github.com/SwitchCraftCC/sc-peripherals) to create 3-dimensional prints. These files contain shapes and other metadata to create 3D prints, special blocks which can have special geometry and other properties + +### Format + +| Information | | +| ----------- | ------------- | +| Version | 1.0.0 | +| Type | 3D Print JSON | +| MIME | `model/3dj` | +| Extensions | `.3dj` | + +2D JSON Image Storage files MUST follow [RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259), "The JavaScript Object Notation (JSON) Data Interchange Format." These files MUST also use the file extension `.3dj`. The file MUST contain an object, with keys and values specified below. + +## States + +3D prints contain two states: + +- Off: When off, all data specified as being off will be used. This is the default state for all 3D prints. +- On: For this to be available, the 3D print MUST contain a `shapesOn` array. + +## Definitions + +### Shape + +A JSON object defining a shape in the 3D print. +**Keys:** + +- `bounds`: MUST be an array of integers zero (0) through sixteen (16), and MUST be of length six (6). The array MUST contain positions in this order: `minX`, `minY`, `minZ`, `maxX`, `maxY`, `maxZ`. +- `texture`: MUST be a string containing a path to a texture. + - Example: `minecraft:block/stone` + - Format: `:/` +- `tint`: MAY be a string, number, or `null`. + - If a string, it MUST follow the `RRGGBB` format. + - If a number, it MUST be between `0x000000` (0) and `0xFFFFFF` (16777215). It SHOULD be represented as a hexadecimal in the file (e.g. `0x16D34B`). + +## Keys + +- `label`: SHOULD contain the name of the 3D print. It MUST be a string. It MUST be a string. +- `tooltip`: MUST be a string or `null`. MAY contain a tooltip with a brief explanation of the 3D print, displayed while hovering over the 3D print in the players inventory. +- `isButton`: MUST be `null` or a boolean. When set, the 3D print will act like a button, pressing the print will shift from the `OFF` state to the `ON` state for a moment. This is `false` by default. +- `collideWhenOff`: MUST be `null` or a boolean, defines whether or not the 3D print will respect collision in the `OFF` state. This is `true` by default. +- `collideWhenOn`: MUST be `null` or a boolean, defines whether or not the 3D print will respect collision in the `ON` state. This is `true` by default. +- `lightLevel`: MUST be an integer from zero (0) to fifteen (15), or `null`. This is zero (0) by default. +- `lightWhenOff`: MUST be an boolean or `null`. This defines if the print will emit light when in the `OFF` state. This is `true` by default. +- `lightWhenOn`: MUST be `null` or a boolean. This defines if the print will emit light when in the `ON` state. This is `true` by default. +- `redstoneLevel`: MUST be `null` or an integer ranging from zero (0) to fifteen (15). This defines the redstone level the 3D print will output. This is zero (0) by default. +- `seatPos`: MUST be `null`, or an array of length three (3). Each value MUST be a number between 0.1 and 0.9. +- `shapesOff`: MUST be an array of shapes (see Definitions), and SHOULD have a length greater than zero (0). This is the shapes that will be displayed in the block. +- `shapesOn`: MUST be an array of shapes (see Definitions). If the ability to switch the print between the `ON` and `OFF` state is not desired, the length of this array MUST be zero (0). + +## References + +-https://docs.sc3.io/features/sc-peripherals.html#_3dj-format