Work Table : respect furthermore original node groups and prevent using them for some cases of crafting
This commit is contained in:
parent
5960872708
commit
f06d14882b
@ -186,13 +186,6 @@ local function description(node, shape)
|
|||||||
return desc
|
return desc
|
||||||
end
|
end
|
||||||
|
|
||||||
local function groups(node)
|
|
||||||
if node:find("tree") or node:find("wood") or node:find("cactus") then
|
|
||||||
return {choppy=3, not_in_creative_inventory=1}
|
|
||||||
end
|
|
||||||
return {cracky=3, not_in_creative_inventory=1}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function shady(shape)
|
local function shady(shape)
|
||||||
if shape == "stair" or shape == "slab" or shape == "innerstair" or
|
if shape == "stair" or shape == "slab" or shape == "innerstair" or
|
||||||
shape == "outerstair" then return false end
|
shape == "outerstair" then return false end
|
||||||
@ -208,6 +201,15 @@ for _, d in pairs(def) do
|
|||||||
for _, n in pairs(nodes) do
|
for _, n in pairs(nodes) do
|
||||||
local ndef = minetest.registered_nodes[n]
|
local ndef = minetest.registered_nodes[n]
|
||||||
if ndef then
|
if ndef then
|
||||||
|
local groups = {}
|
||||||
|
groups.not_in_creative_inventory=1
|
||||||
|
|
||||||
|
for k, v in pairs(ndef.groups)
|
||||||
|
do if k ~= "wood" and k ~= "stone" then
|
||||||
|
groups[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_node(":"..n.."_"..d[1], {
|
minetest.register_node(":"..n.."_"..d[1], {
|
||||||
description = description(n, d[1]),
|
description = description(n, d[1]),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
@ -216,7 +218,7 @@ for _, n in pairs(nodes) do
|
|||||||
light_source = ndef.light_source,
|
light_source = ndef.light_source,
|
||||||
sounds = ndef.sounds,
|
sounds = ndef.sounds,
|
||||||
tiles = tiles(n, ndef),
|
tiles = tiles(n, ndef),
|
||||||
groups = groups(n),
|
groups = groups,
|
||||||
node_box = {type = "fixed", fixed = d[3]},
|
node_box = {type = "fixed", fixed = d[3]},
|
||||||
sunlight_propagates = shady(d[1]),
|
sunlight_propagates = shady(d[1]),
|
||||||
on_place = minetest.rotate_node
|
on_place = minetest.rotate_node
|
||||||
|
Loading…
Reference in New Issue
Block a user