Automatically add door group to doors and trapdoors

This commit is contained in:
Wuzzy 2017-03-30 04:21:23 +02:00
parent 384462369e
commit 63e25b4e09
1 changed files with 15 additions and 9 deletions

View File

@ -22,6 +22,7 @@ mcl_doors = {}
function mcl_doors:register_door(name, def) function mcl_doors:register_door(name, def)
def.groups.not_in_creative_inventory = 1 def.groups.not_in_creative_inventory = 1
def.groups.dig_by_piston = 1 def.groups.dig_by_piston = 1
def.groups.door = 1
if not def.sound_open then if not def.sound_open then
def.sound_open = "doors_door_open" def.sound_open = "doors_door_open"
@ -388,7 +389,7 @@ mcl_doors:register_door("mcl_doors:wooden_door", {
_doc_items_longdesc = wood_longdesc, _doc_items_longdesc = wood_longdesc,
_doc_items_usagehelp = wood_usagehelp, _doc_items_usagehelp = wood_usagehelp,
inventory_image = "door_wood.png", inventory_image = "door_wood.png",
groups = {handy=1,axey=1, door=1, material_wood=1}, groups = {handy=1,axey=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
tiles_bottom = {"door_wood_b.png", "door_wood_b.png"}, tiles_bottom = {"door_wood_b.png", "door_wood_b.png"},
tiles_top = {"door_wood_a.png", "door_wood_a.png"}, tiles_top = {"door_wood_a.png", "door_wood_a.png"},
@ -410,7 +411,7 @@ mcl_doors:register_door("mcl_doors:acacia_door", {
_doc_items_longdesc = wood_longdesc, _doc_items_longdesc = wood_longdesc,
_doc_items_usagehelp = wood_usagehelp, _doc_items_usagehelp = wood_usagehelp,
inventory_image = "door_acacia.png", inventory_image = "door_acacia.png",
groups = {handy=1,axey=1, door=1, material_wood=1}, groups = {handy=1,axey=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
tiles_bottom = {"door_acacia_b.png", "door_acacia_b.png"}, tiles_bottom = {"door_acacia_b.png", "door_acacia_b.png"},
tiles_top = {"door_acacia_a.png", "door_acacia_a.png"}, tiles_top = {"door_acacia_a.png", "door_acacia_a.png"},
@ -432,7 +433,7 @@ mcl_doors:register_door("mcl_doors:birch_door", {
_doc_items_longdesc = wood_longdesc, _doc_items_longdesc = wood_longdesc,
_doc_items_usagehelp = wood_usagehelp, _doc_items_usagehelp = wood_usagehelp,
inventory_image = "door_birch.png", inventory_image = "door_birch.png",
groups = {handy=1,axey=1, door=1, material_wood=1}, groups = {handy=1,axey=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
tiles_bottom = {"door_birch_b.png", "door_birch_b.png"}, tiles_bottom = {"door_birch_b.png", "door_birch_b.png"},
tiles_top = {"door_birch_a.png", "door_birch_a.png"}, tiles_top = {"door_birch_a.png", "door_birch_a.png"},
@ -454,7 +455,7 @@ mcl_doors:register_door("mcl_doors:dark_oak_door", {
_doc_items_longdesc = wood_longdesc, _doc_items_longdesc = wood_longdesc,
_doc_items_usagehelp = wood_usagehelp, _doc_items_usagehelp = wood_usagehelp,
inventory_image = "door_dark_oak.png", inventory_image = "door_dark_oak.png",
groups = {handy=1,axey=1, door=1, material_wood=1}, groups = {handy=1,axey=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
tiles_bottom = {"door_dark_oak_b.png", "door_dark_oak_b.png"}, tiles_bottom = {"door_dark_oak_b.png", "door_dark_oak_b.png"},
tiles_top = {"door_dark_oak_a.png", "door_dark_oak_a.png"}, tiles_top = {"door_dark_oak_a.png", "door_dark_oak_a.png"},
@ -476,7 +477,7 @@ mcl_doors:register_door("mcl_doors:jungle_door", {
_doc_items_longdesc = wood_longdesc, _doc_items_longdesc = wood_longdesc,
_doc_items_usagehelp = wood_usagehelp, _doc_items_usagehelp = wood_usagehelp,
inventory_image = "door_jungle.png", inventory_image = "door_jungle.png",
groups = {handy=1,axey=1, door=1, material_wood=1}, groups = {handy=1,axey=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
tiles_bottom = {"door_jungle_b.png", "door_jungle_b.png"}, tiles_bottom = {"door_jungle_b.png", "door_jungle_b.png"},
tiles_top = {"door_jungle_a.png", "door_jungle_a.png"}, tiles_top = {"door_jungle_a.png", "door_jungle_a.png"},
@ -498,7 +499,7 @@ mcl_doors:register_door("mcl_doors:spruce_door", {
_doc_items_longdesc = wood_longdesc, _doc_items_longdesc = wood_longdesc,
_doc_items_usagehelp = wood_usagehelp, _doc_items_usagehelp = wood_usagehelp,
inventory_image = "door_spruce.png", inventory_image = "door_spruce.png",
groups = {handy=1,axey=1, door=1, material_wood=1}, groups = {handy=1,axey=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
tiles_bottom = {"door_spruce_b.png", "door_spruce_b.png"}, tiles_bottom = {"door_spruce_b.png", "door_spruce_b.png"},
tiles_top = {"door_spruce_a.png", "door_spruce_a.png"}, tiles_top = {"door_spruce_a.png", "door_spruce_a.png"},
@ -551,7 +552,7 @@ mcl_doors:register_door("mcl_doors:iron_door", {
_doc_items_longdesc = "Iron doors are 2-block high barriers which can only be opened or closed by a redstone signal, but not by hand.", _doc_items_longdesc = "Iron doors are 2-block high barriers which can only be opened or closed by a redstone signal, but not by hand.",
_doc_items_usagehelp = "To open or close an iron door, supply its lower half with a redstone signal.", _doc_items_usagehelp = "To open or close an iron door, supply its lower half with a redstone signal.",
inventory_image = "door_steel.png", inventory_image = "door_steel.png",
groups = {pickaxey=1, door=1,mesecon_effector_on=1}, groups = {pickaxey=1, mesecon_effector_on=1},
_mcl_hardness = 5, _mcl_hardness = 5,
tiles_bottom = {"door_steel_b.png^[transformFX", "door_steel_b.png^[transformFX"}, tiles_bottom = {"door_steel_b.png^[transformFX", "door_steel_b.png^[transformFX"},
tiles_top = {"door_steel_a.png^[transformFX", "door_steel_a.png^[transformFX"}, tiles_top = {"door_steel_a.png^[transformFX", "door_steel_a.png^[transformFX"},
@ -578,6 +579,11 @@ function mcl_doors:register_trapdoor(name, def)
minetest.set_node(pos, node) minetest.set_node(pos, node)
end end
if def.groups == nil then
def.groups = {}
end
def.groups.door = 2
if not def.sound_open then if not def.sound_open then
def.sound_open = "doors_door_open" def.sound_open = "doors_door_open"
end end
@ -696,7 +702,7 @@ mcl_doors:register_trapdoor("mcl_doors:trapdoor", {
_doc_items_usagehelp = "To open or close the trapdoor, rightclick it or send a redstone signal to it.", _doc_items_usagehelp = "To open or close the trapdoor, rightclick it or send a redstone signal to it.",
tiles = {"door_trapdoor.png"}, tiles = {"door_trapdoor.png"},
wield_image = "door_trapdoor.png", wield_image = "door_trapdoor.png",
groups = {handy=1,axey=1, mesecon_effector_on=1,door=2, material_wood=1}, groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1},
_mcl_hardness = 3, _mcl_hardness = 3,
sounds = mcl_sounds.node_sound_wood_defaults(), sounds = mcl_sounds.node_sound_wood_defaults(),
}) })
@ -720,7 +726,7 @@ mcl_doors:register_trapdoor("mcl_doors:iron_trapdoor", {
_doc_items_longdesc = "Iron trapdoors are floor covers which can only be opened and closed by redstone signals, but not by hand.", _doc_items_longdesc = "Iron trapdoors are floor covers which can only be opened and closed by redstone signals, but not by hand.",
tiles = {"iron_trapdoor.png"}, tiles = {"iron_trapdoor.png"},
wield_image = "iron_trapdoor.png", wield_image = "iron_trapdoor.png",
groups = {pickaxey=1, mesecon_effector_on=1,door=2}, groups = {pickaxey=1, mesecon_effector_on=1},
_mcl_hardness = 5, _mcl_hardness = 5,
sounds = mcl_sounds.node_sound_metal_defaults(), sounds = mcl_sounds.node_sound_metal_defaults(),
sound_open = "doors_steel_door_open", sound_open = "doors_steel_door_open",