mirror of
https://github.com/mt-mods/xcompat.git
synced 2025-11-23 10:55:22 +01:00
Add explanations of textures & player api usage, non-function sounds, and some minor touch-up of docs (#55)
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
# Materials API
|
||||
|
||||
## Usage
|
||||
|
||||
The materials can be accessed anywhere in your mod with `xcompat.materials.material_name`.
|
||||
|
||||
**Example**: `xcompat.materials.steel_ingot` returns the string of whichever item would closest represent the steel_ingot material in the current game.
|
||||
Behind the scenes, xcompat automatically changes the `xcompat.materials`
|
||||
variable to contain the correct materials for whichever game the mod is
|
||||
launched in.
|
||||
|
||||
Behind the scenes, the xcompat mod automatically changes the `xcompat.materials` variable to contain the correct materials for whichever game the mod is launched in.
|
||||
## Game support
|
||||
|
||||
See the [the support table in the readme](https://github.com/mt-mods/xcompat/tree/master?tab=readme-ov-file#directly-supported-games-and-mods) for an overview of supported games, and see the contents of `/src/materials/` for the supported materials and their names.
|
||||
See the [the support table in the readme](https://github.com/mt-mods/xcompat/tree/master?tab=readme-ov-file#directly-supported-games-and-mods)
|
||||
for an overview of supported games, and see the contents of `/src/materials/`
|
||||
for the supported materials and their names.
|
||||
|
||||
**Example**: the `/src/materials/mineclonia.lua` file shows what the keys of `xcompat.materials` resolve to when playing Mineclonia, such as `xcompat.materials.steel_ingot` resolving to `mcl_core:iron_ingot`, and `xcompat.materials.mesa_crystal` resolving to `mcl_redstone:redstone` if supported.
|
||||
## Examples
|
||||
|
||||
Writing `xcompat.materials.steel_ingot` returns the string of whichever item
|
||||
would closest represent the `steel_ingot` material in the current game.
|
||||
|
||||
The `/src/materials/mineclonia.lua` file shows what the keys of
|
||||
`xcompat.materials` resolve to when playing Mineclonia, such as
|
||||
`xcompat.materials.steel_ingot` resolving to `mcl_core:iron_ingot`, and
|
||||
`xcompat.materials.mesa_crystal` resolving to `mcl_redstone:redstone` if
|
||||
supported.
|
||||
|
||||
Reference in New Issue
Block a user