mirror of
https://github.com/minetest-mods/carpets.git
synced 2024-12-30 00:47:28 +01:00
removed base_material and moved shape_type to groups usage
This commit is contained in:
parent
384dbb964a
commit
412d3ffcc7
5
api.lua
5
api.lua
@ -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
|
||||
|
31
init.lua
31
init.lua
@ -20,17 +20,34 @@ local function filter(name, def)
|
||||
end
|
||||
|
||||
-- no 3rd hand carpets
|
||||
if def.base_material then
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user