diff --git a/docs/apidoc/index.md b/docs/apidoc/index.md index 73623df..e88d90f 100644 --- a/docs/apidoc/index.md +++ b/docs/apidoc/index.md @@ -65,13 +65,16 @@ The global object has the following properties: - Once the dedicated server worker has started, it is unuseable. - More: [DedicatedServerDocumentation](dedicatedserver.md) - `ModAPI.meta` - - This object is used to register metadata for mods such as their title, credits, icon and description. + - This module is used to register metadata for mods such as their title, credits, icon and description. - More: [MetaDocumentation](meta.md) - `ModAPI.array` - - This object is used to interact and create arrays easily. + - This module is used to interact and create arrays easily. - More: [ArrayDocumentation](array.md) +- `ModAPI.keygen` + - This module is used to get IDs for registering blocks and items without hardcoding an ID. + - More: [KeygenDocumentation](keygen.md) - `ModAPI.resolution` - - This object is used to query information about GUI dimensions, to make drawing to the screen easier, generated when the `frame` event is fired. + - This module is used to query information about GUI dimensions, to make drawing to the screen easier, generated when the `frame` event is fired. - Deprecated alias (please do not use): `ModAPI.ScaledResolution` - More: [ArrayDocumentation](array.md) - `ModAPI.version: String` diff --git a/docs/apidoc/keygen.md b/docs/apidoc/keygen.md new file mode 100644 index 0000000..17c5cd9 --- /dev/null +++ b/docs/apidoc/keygen.md @@ -0,0 +1,8 @@ +## ModAPI.keygen +ModAPI.keygen contains the API for getting item and block IDs from a string. It looks at the registries for items and blocks to derive the IDs, so IDs will not be automatically reserved until a block/item is actually registered. Ideally, you'd want to call a keygen method just before registering your block. + +Methods: +- `ModAPI.keygen.item(itemId: String) : number` + - Example usage is: `var id = ModAPI.keygen.item("my_example_item");` +- `ModAPI.keygen.block(blockId: String) : number` + - Example usage is: `var id = ModAPI.keygen.block("my_example_block");` \ No newline at end of file