Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCSMB-15: Wide Printer Format (2dj) and Wide Printer Format Array (2dja) Formats and CCSMB-16: 3D Print JSON (3dj) #31

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Standards/CCSMB-15.md
znepb marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# _CCSMB-12_: Wide Printer Format and Wide Printer Format Array
znepb marked this conversation as resolved.
Show resolved Hide resolved

_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
znepb marked this conversation as resolved.
Show resolved Hide resolved

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.
znepb marked this conversation as resolved.
Show resolved Hide resolved

## 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`.

### Keys
znepb marked this conversation as resolved.
Show resolved Hide resolved

- `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.
tomodachi94 marked this conversation as resolved.
Show resolved Hide resolved
- 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`.

### 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
62 changes: 62 additions & 0 deletions Standards/CCSMB-16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# _CCSMB-12_: 3D Print JSON
znepb marked this conversation as resolved.
Show resolved Hide resolved

_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

##3 Format
znepb marked this conversation as resolved.
Show resolved Hide resolved

| 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 `.2dj`.

## 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: `<namespace>:<type>/<file>`
- `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