interface.lua
This module is a generic function interface for general, generic interface formats and protocols. The only current module that uses this is modem.lua
. This module does not do anything beyond provide the methods, any other desired functionality (i.e. user authentification, privilages, etc) should be handled by another module.
Interface Information
To call an interface method, use interface.interface.callMethod
.
The genericInterface.list
method returns a table nicer for general use, it is an array of tables with the following contents.
name
Item ID of the namenbt
NBT hash of the item (or"NONE"
)count
Total count of this item in the system It will also contain any other informationgetItemDetail
would for that item. For exampleenchantments
ordisplayName
. This list will only contain one entry for each item.
If your interface wishes to provide updates for "inventoryUpdate"
events use interface.addInventoryUpdateHandler
. This will pass the result of genericInterface.list
into your function anytime the inventory contents change.
Internal Information
Adding an interface method is very simple, just add the function to genericInterface
.