Add charge set/get callbacks (#600)

For the easier making of multi mod chargeable tools.
This commit is contained in:
sfence
2022-06-06 18:53:50 +02:00
committed by GitHub
parent d2b68a6bef
commit 0211c582e9
2 changed files with 52 additions and 27 deletions

View File

@ -144,6 +144,12 @@ Additional definition fields:
* Specifies the machine's node name to use when it's not connected connected to a network
* `<itemdef>.technic_on_disable = function(pos, node) ...`
* This callback is run when the machine is no longer connected to a technic-powered network.
* `<itemdef>.technic_get_charge = function(itemstack) ...`
* This optional callback will be used to get itemstack charge and max\_charge
* Have to return values `charge, max_charge`
* Etc. `local charge, maxcharge = itemdef.technic_get_charge(itemstack)`
* `<itemdef>.technic_set_charge = function(itemstack, charge) ...`
* This optional callback will be used to set itemstack charge
## Node Metadata fields