removed base_material and moved shape_type to groups usage

This commit is contained in:
Alexander Weber 2017-03-16 23:53:55 +01:00
parent 384dbb964a
commit 412d3ffcc7
2 changed files with 27 additions and 11 deletions

@ -15,7 +15,8 @@ local carpet_proto = {
snappy = 2,
flammable = 3,
oddly_breakable_by_hand = 3,
choppy = 2
choppy = 2,
carpet = 1,
}
}
@ -45,8 +46,6 @@ function carpets.register(recipe, def)
if node.tiles[6] then
node.tiles = {node.tiles[6]}
end
node.base_material = recipe
node.shape_type = "carpet"
if config:get_bool("FallingCarpet") and node.groups.falling_node == nil then
node.groups.falling_node = 1

@ -20,17 +20,34 @@ local function filter(name, def)
end
-- no 3rd hand carpets
if def.base_material then
return false
local ignore_groups = {
not_in_creative_inventory = true,
carpet = true,
door = true,
fence = true,
stair = true,
slab = true,
wall = true,
micro = true,
panel = true,
slope = true,
}
for k,v in pairs(def.groups) do
if ignore_groups[k] then
return false
end
end
-- not supported node types for carpets
if def.drawtype == "liquid" or
def.drawtype == "firelike" or
def.drawtype == "airlike" or
def.drawtype == "plantlike" or
def.drawtype == "nodebox" or
def.drawtype == "raillike" then
local ignore_drawtype = {
liquid = true,
firelike = true,
airlike = true,
plantlike = true,
nodebox = true,
raillike = true,
}
if ignore_drawtype[def.drawtype] then
return false
end