Skip to content

Commit

Permalink
API: make skins.register_skin public
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Jun 25, 2024
1 parent 11bb5ba commit 1efe139
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ Get all allowed skins for player. All public and all player's private skins. If
Get all skins with metadata key is set to value. Example:
skins.get_skinlist_with_meta("playername", playername) - Get all private skins (w.o. public) for playername

## skins.register_skin(path, filename)
Registers a new skin based on the texture file path specified by `path` and `filename`.

* `path` (string): points to the parent directory of the texture `filename`.
Generally, this should be in the format `mymod.modpath .. "/textures"`.
* `filename` (string): full file name, without any path specifications.
The file name must adhere to [one of the accepted naming formats](textures/readme.txt).

Return values:

* On failure: `false, reason`
* `reason` (string): human readable reason string (similar to `io.open` errors)
* On success: `true, key`
* `key`: unique skins key for use with e.g. `skins.get(key)` for subsequent
fine-tuning of the skin registration.


## skins.new(key, object)
Create and register a new skin object for given key
Expand Down

0 comments on commit 1efe139

Please sign in to comment.