mirror of
https://github.com/minetest-mods/carpets.git
synced 2024-12-21 04:45:42 +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,
|
snappy = 2,
|
||||||
flammable = 3,
|
flammable = 3,
|
||||||
oddly_breakable_by_hand = 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
|
if node.tiles[6] then
|
||||||
node.tiles = {node.tiles[6]}
|
node.tiles = {node.tiles[6]}
|
||||||
end
|
end
|
||||||
node.base_material = recipe
|
|
||||||
node.shape_type = "carpet"
|
|
||||||
|
|
||||||
if config:get_bool("FallingCarpet") and node.groups.falling_node == nil then
|
if config:get_bool("FallingCarpet") and node.groups.falling_node == nil then
|
||||||
node.groups.falling_node = 1
|
node.groups.falling_node = 1
|
||||||
|
31
init.lua
31
init.lua
@ -20,17 +20,34 @@ local function filter(name, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- no 3rd hand carpets
|
-- 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
|
return false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- not supported node types for carpets
|
-- not supported node types for carpets
|
||||||
if def.drawtype == "liquid" or
|
local ignore_drawtype = {
|
||||||
def.drawtype == "firelike" or
|
liquid = true,
|
||||||
def.drawtype == "airlike" or
|
firelike = true,
|
||||||
def.drawtype == "plantlike" or
|
airlike = true,
|
||||||
def.drawtype == "nodebox" or
|
plantlike = true,
|
||||||
def.drawtype == "raillike" then
|
nodebox = true,
|
||||||
|
raillike = true,
|
||||||
|
}
|
||||||
|
if ignore_drawtype[def.drawtype] then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user