mirror of
https://codeberg.org/minenux/minetest-mod-xdecor
synced 2023-10-20 21:43:39 -07:00
Workbench: allow to register custom cuttable nodes (defined by user)
This commit is contained in:
parent
6bd045e3de
commit
388ae38841
@ -46,8 +46,6 @@ function mailbox:formspec(pos, owner, num)
|
|||||||
local stack_count = stack:match("%s(%d+)") or 1
|
local stack_count = stack:match("%s(%d+)") or 1
|
||||||
|
|
||||||
giver = giver.."#FFFF00,"..giver_name..","..i..",#FFFFFF,x "..stack_count..","
|
giver = giver.."#FFFF00,"..giver_name..","..i..",#FFFFFF,x "..stack_count..","
|
||||||
-- Hack to force using a 16px resolution for images in formspec's tablecolumn.
|
|
||||||
-- The engine doesn't scale them automatically yet.
|
|
||||||
img = img..i.."="..img_col(stack_name).."^\\[resize:16x16,"
|
img = img..i.."="..img_col(stack_name).."^\\[resize:16x16,"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,6 +23,22 @@ for node, def in pairs(minetest.registered_nodes) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Optionally, you can register custom cuttable nodes in the workbench
|
||||||
|
workbench.custom_nodes_register = {
|
||||||
|
-- "default:leaves",
|
||||||
|
}
|
||||||
|
|
||||||
|
setmetatable(nodes, {
|
||||||
|
__concat = function(t1, t2)
|
||||||
|
for k in pairs(t2) do
|
||||||
|
t1[#t1+1] = t2[k]
|
||||||
|
end
|
||||||
|
return t1
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
nodes = nodes..workbench.custom_nodes_register
|
||||||
|
|
||||||
-- Nodeboxes definitions.
|
-- Nodeboxes definitions.
|
||||||
workbench.defs = {
|
workbench.defs = {
|
||||||
-- Name Yield X Y Z W H L
|
-- Name Yield X Y Z W H L
|
||||||
|
Loading…
x
Reference in New Issue
Block a user