removed passing genarator to the task to support generator-less lists
This commit is contained in:
parent
49e34a37ed
commit
ea9934c305
@ -115,7 +115,7 @@ customnode.register_task(name, function) - register a new task, that can be used
|
||||
|
||||
## Extended example
|
||||
```
|
||||
customnode.register_task("recipe", function(nodedef, generator)
|
||||
customnode.register_task("recipe", function(nodedef)
|
||||
minetest.register_craft({
|
||||
output = nodedef.name,
|
||||
recipe = {
|
||||
|
@ -55,7 +55,6 @@ end
|
||||
-- API Call - Get variant object
|
||||
----------------------------------------------------
|
||||
function customnode.get_variant(name)
|
||||
print("get variant", name)
|
||||
if name:match(":") then
|
||||
return customnode._variants[name]
|
||||
else
|
||||
@ -189,7 +188,7 @@ function customnode.add_nodes_from_textures(conf)
|
||||
local nodedef = generator:get_nodedef()
|
||||
if nodedef then
|
||||
for _, task in ipairs(generator.variant.tasks) do
|
||||
task(nodedef, generator)
|
||||
task(nodedef)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -8,10 +8,10 @@ end)
|
||||
----------------------------------------------------
|
||||
-- task for stairs and slabs using stairs mod
|
||||
----------------------------------------------------
|
||||
customnode.register_task("stairs:stairs_slabs", function(nodedef, generator)
|
||||
customnode.register_task("stairs:stairs_slabs", function(nodedef)
|
||||
if minetest.global_exists("stairs") then
|
||||
stairs.register_stair_and_slab(
|
||||
generator.modname.."_"..generator:get_name(),
|
||||
nodedef.name:gsub(':','_'),
|
||||
nodedef.name,
|
||||
table.copy(nodedef.groups),
|
||||
table.copy(nodedef.tiles),
|
||||
@ -23,7 +23,7 @@ customnode.register_task("stairs:stairs_slabs", function(nodedef, generator)
|
||||
end)
|
||||
|
||||
|
||||
customnode.register_task("carpets:carpet", function(nodedef, generator)
|
||||
customnode.register_task("carpets:carpet", function(nodedef)
|
||||
if minetest.global_exists("carpets") then
|
||||
carpets.register(nodedef.name)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user