mirror of
https://github.com/minetest-mods/technic.git
synced 2025-06-30 23:30:38 +02:00
Add register_cable_tier API function to allow user defined cables registration.
This commit is contained in:
@ -35,6 +35,10 @@ Available functions:
|
|||||||
* `technic.is_tier_cable(nodename, tier)`
|
* `technic.is_tier_cable(nodename, tier)`
|
||||||
* Tells whether the node `nodename` is the cable of the tier `tier`.
|
* Tells whether the node `nodename` is the cable of the tier `tier`.
|
||||||
* Short version of `technic.get_cable_tier(nodename) == tier`
|
* Short version of `technic.get_cable_tier(nodename) == tier`
|
||||||
|
* `technic.register_cable_tier(nodename, tier)`
|
||||||
|
* Register user defined cable to list of known tier cables.
|
||||||
|
* `nodename`: string, name of the node
|
||||||
|
* `tier`: string, tier name
|
||||||
|
|
||||||
|
|
||||||
## Machines
|
## Machines
|
||||||
|
@ -11,6 +11,10 @@ function technic.get_cable_tier(name)
|
|||||||
return cable_tier[name]
|
return cable_tier[name]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function technic.register_cable_tier(name, tier)
|
||||||
|
cable_tier[name] = tier
|
||||||
|
end
|
||||||
|
|
||||||
local function check_connections(pos)
|
local function check_connections(pos)
|
||||||
-- Build a table of all machines
|
-- Build a table of all machines
|
||||||
local machines = {}
|
local machines = {}
|
||||||
|
Reference in New Issue
Block a user