Add API docs
parent
680cabdfcd
commit
b76b059f1c
|
@ -0,0 +1,25 @@
|
||||||
|
# Easyvend API
|
||||||
|
Use this API if you want to make an comntainer compatible with vending and
|
||||||
|
depositing machines.
|
||||||
|
|
||||||
|
The API only has one function:
|
||||||
|
|
||||||
|
## `easyvend.register_chest = function(node_name, inv_list, meta_owner)`
|
||||||
|
Registers a node (called “chest”) for use with Easyvend. After calling this function,
|
||||||
|
the node will be recognized as storage for vending and depositing machines.
|
||||||
|
|
||||||
|
Easyvend makes the following assumptions about the chest:
|
||||||
|
* It has an inventory
|
||||||
|
* The inventory does not restrict the types of items you can put and take
|
||||||
|
* The chest is owned by a player
|
||||||
|
* The owner is specified in metadata
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
* `node_name`: Name of the chest node
|
||||||
|
* `inv_list`: Name of the inventory list for exchanging items
|
||||||
|
* `meta_owner`: Identifier of the metadata variable storing the owner name
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```
|
||||||
|
easyvend.register_chest("example:superchest", "main", "owner")
|
||||||
|
```
|
|
@ -27,6 +27,10 @@ But it can be changed via the setting `easyvend_currency`.
|
||||||
|
|
||||||
|
|
||||||
## Appendix
|
## Appendix
|
||||||
|
### Developer information
|
||||||
|
If you want to a container node compatible with vending/depositing machines,
|
||||||
|
use the Easyvend API, see the file `API.md`.
|
||||||
|
|
||||||
### Converting machines from `vendor` mod (experimental)
|
### Converting machines from `vendor` mod (experimental)
|
||||||
This mod is able to automatically transform the vending and depositing
|
This mod is able to automatically transform the vending and depositing
|
||||||
machines from Bad\_Command\_'s Vending machines [`vendor`] mod on loading
|
machines from Bad\_Command\_'s Vending machines [`vendor`] mod on loading
|
||||||
|
|
Loading…
Reference in New Issue