2021-05-29 17:12:33 +03:00
local S = minetest.get_translator ( minetest.get_current_modname ( ) )
2019-03-08 01:00:09 +02:00
2017-06-05 22:57:23 +03:00
--[[ Doors ]]
2019-03-08 01:00:09 +02:00
local wood_longdesc = S ( " Wooden doors are 2-block high barriers which can be opened or closed by hand and by a redstone signal. " )
local wood_usagehelp = S ( " To open or close a wooden door, rightclick it or supply its lower half with a redstone signal. " )
2017-06-05 22:57:23 +03:00
--- Oak Door ---
mcl_doors : register_door ( " mcl_doors:wooden_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Oak Door " ) ,
2017-06-05 22:57:23 +03:00
_doc_items_longdesc = wood_longdesc ,
_doc_items_usagehelp = wood_usagehelp ,
2017-07-17 14:22:46 +03:00
inventory_image = " doors_item_wood.png " ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , material_wood = 1 , flammable =- 1 } ,
2017-06-05 22:57:23 +03:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_wood_lower.png " , " mcl_doors_door_wood_side_lower.png " } ,
tiles_top = { " mcl_doors_door_wood_upper.png " , " mcl_doors_door_wood_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
minetest.register_craft ( {
output = " mcl_doors:wooden_door 3 " ,
recipe = {
{ " mcl_core:wood " , " mcl_core:wood " } ,
{ " mcl_core:wood " , " mcl_core:wood " } ,
{ " mcl_core:wood " , " mcl_core:wood " }
}
} )
--- Acacia Door --
mcl_doors : register_door ( " mcl_doors:acacia_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Acacia Door " ) ,
2017-06-05 22:57:23 +03:00
_doc_items_longdesc = wood_longdesc ,
_doc_items_usagehelp = wood_usagehelp ,
2017-07-17 14:22:46 +03:00
inventory_image = " mcl_doors_door_acacia.png " ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , material_wood = 1 , flammable =- 1 } ,
2017-06-05 22:57:23 +03:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_acacia_lower.png " , " mcl_doors_door_acacia_side_lower.png " } ,
tiles_top = { " mcl_doors_door_acacia_upper.png " , " mcl_doors_door_acacia_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
minetest.register_craft ( {
output = " mcl_doors:acacia_door 3 " ,
recipe = {
{ " mcl_core:acaciawood " , " mcl_core:acaciawood " } ,
{ " mcl_core:acaciawood " , " mcl_core:acaciawood " } ,
{ " mcl_core:acaciawood " , " mcl_core:acaciawood " }
}
} )
--- Birch Door --
mcl_doors : register_door ( " mcl_doors:birch_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Birch Door " ) ,
2017-06-05 22:57:23 +03:00
_doc_items_longdesc = wood_longdesc ,
_doc_items_usagehelp = wood_usagehelp ,
2017-07-17 14:22:46 +03:00
inventory_image = " mcl_doors_door_birch.png " ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , material_wood = 1 , flammable =- 1 } ,
2017-06-05 22:57:23 +03:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_birch_lower.png " , " mcl_doors_door_birch_side_lower.png " } ,
tiles_top = { " mcl_doors_door_birch_upper.png " , " mcl_doors_door_birch_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
minetest.register_craft ( {
output = " mcl_doors:birch_door 3 " ,
recipe = {
{ " mcl_core:birchwood " , " mcl_core:birchwood " } ,
{ " mcl_core:birchwood " , " mcl_core:birchwood " } ,
{ " mcl_core:birchwood " , " mcl_core:birchwood " } ,
}
} )
--- Dark Oak Door --
mcl_doors : register_door ( " mcl_doors:dark_oak_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Dark Oak Door " ) ,
2017-06-05 22:57:23 +03:00
_doc_items_longdesc = wood_longdesc ,
_doc_items_usagehelp = wood_usagehelp ,
2017-07-17 14:22:46 +03:00
inventory_image = " mcl_doors_door_dark_oak.png " ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , material_wood = 1 , flammable =- 1 } ,
2017-06-05 22:57:23 +03:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_dark_oak_lower.png " , " mcl_doors_door_dark_oak_side_lower.png " } ,
tiles_top = { " mcl_doors_door_dark_oak_upper.png " , " mcl_doors_door_dark_oak_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
minetest.register_craft ( {
output = " mcl_doors:dark_oak_door 3 " ,
recipe = {
{ " mcl_core:darkwood " , " mcl_core:darkwood " } ,
{ " mcl_core:darkwood " , " mcl_core:darkwood " } ,
{ " mcl_core:darkwood " , " mcl_core:darkwood " } ,
}
} )
--- Jungle Door --
mcl_doors : register_door ( " mcl_doors:jungle_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Jungle Door " ) ,
2017-06-05 22:57:23 +03:00
_doc_items_longdesc = wood_longdesc ,
_doc_items_usagehelp = wood_usagehelp ,
2017-07-17 14:22:46 +03:00
inventory_image = " mcl_doors_door_jungle.png " ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , material_wood = 1 , flammable =- 1 } ,
2017-06-05 22:57:23 +03:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_jungle_lower.png " , " mcl_doors_door_jungle_side_lower.png " } ,
tiles_top = { " mcl_doors_door_jungle_upper.png " , " mcl_doors_door_jungle_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
minetest.register_craft ( {
output = " mcl_doors:jungle_door 3 " ,
recipe = {
{ " mcl_core:junglewood " , " mcl_core:junglewood " } ,
{ " mcl_core:junglewood " , " mcl_core:junglewood " } ,
{ " mcl_core:junglewood " , " mcl_core:junglewood " }
}
} )
--- Spruce Door --
mcl_doors : register_door ( " mcl_doors:spruce_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Spruce Door " ) ,
2017-06-05 22:57:23 +03:00
_doc_items_longdesc = wood_longdesc ,
_doc_items_usagehelp = wood_usagehelp ,
2017-07-17 14:22:46 +03:00
inventory_image = " mcl_doors_door_spruce.png " ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , material_wood = 1 , flammable =- 1 } ,
2017-06-05 22:57:23 +03:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_spruce_lower.png " , " mcl_doors_door_spruce_side_lower.png " } ,
tiles_top = { " mcl_doors_door_spruce_upper.png " , " mcl_doors_door_spruce_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
minetest.register_craft ( {
output = " mcl_doors:spruce_door 3 " ,
recipe = {
{ " mcl_core:sprucewood " , " mcl_core:sprucewood " } ,
{ " mcl_core:sprucewood " , " mcl_core:sprucewood " } ,
{ " mcl_core:sprucewood " , " mcl_core:sprucewood " }
}
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors:wooden_door " ,
burntime = 10 ,
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors:jungle_door " ,
burntime = 10 ,
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors:dark_oak_door " ,
burntime = 10 ,
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors:birch_door " ,
burntime = 10 ,
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors:acacia_door " ,
burntime = 10 ,
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors:spruce_door " ,
burntime = 10 ,
} )
2017-06-05 23:09:48 +03:00
--- Iron Door ---
2017-06-05 22:57:23 +03:00
mcl_doors : register_door ( " mcl_doors:iron_door " , {
2019-03-08 01:00:09 +02:00
description = S ( " Iron Door " ) ,
_doc_items_longdesc = S ( " 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 = S ( " To open or close an iron door, supply its lower half with a redstone signal. " ) ,
2017-07-17 14:22:46 +03:00
inventory_image = " doors_item_steel.png " ,
2017-06-05 22:57:23 +03:00
groups = { pickaxey = 1 , mesecon_effector_on = 1 } ,
_mcl_hardness = 5 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 5 ,
2017-11-17 23:46:42 +02:00
tiles_bottom = { " mcl_doors_door_iron_lower.png^[transformFX " , " mcl_doors_door_iron_side_lower.png " } ,
tiles_top = { " mcl_doors_door_iron_upper.png^[transformFX " , " mcl_doors_door_iron_side_upper.png " } ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_metal_defaults ( ) ,
sound_open = " doors_steel_door_open " ,
sound_close = " doors_steel_door_close " ,
only_redstone_can_open = true ,
} )
minetest.register_craft ( {
output = " mcl_doors:iron_door 3 " ,
recipe = {
{ " mcl_core:iron_ingot " , " mcl_core:iron_ingot " } ,
{ " mcl_core:iron_ingot " , " mcl_core:iron_ingot " } ,
{ " mcl_core:iron_ingot " , " mcl_core:iron_ingot " }
}
} )
--[[ Trapdoors ]]
2017-11-24 13:07:16 +02:00
local woods = {
-- id, desc, texture, craftitem
2019-03-08 01:00:09 +02:00
{ " trapdoor " , S ( " Oak Trapdoor " ) , " doors_trapdoor.png " , " doors_trapdoor_side.png " , " mcl_core:wood " } ,
{ " acacia_trapdoor " , S ( " Acacia Trapdoor " ) , " mcl_doors_trapdoor_acacia.png " , " mcl_doors_trapdoor_acacia_side.png " , " mcl_core:acaciawood " } ,
{ " birch_trapdoor " , S ( " Birch Trapdoor " ) , " mcl_doors_trapdoor_birch.png " , " mcl_doors_trapdoor_birch_side.png " , " mcl_core:birchwood " } ,
{ " spruce_trapdoor " , S ( " Spruce Trapdoor " ) , " mcl_doors_trapdoor_spruce.png " , " mcl_doors_trapdoor_spruce_side.png " , " mcl_core:sprucewood " } ,
{ " dark_oak_trapdoor " , S ( " Dark Oak Trapdoor " ) , " mcl_doors_trapdoor_dark_oak.png " , " mcl_doors_trapdoor_dark_oak_side.png " , " mcl_core:darkwood " } ,
{ " jungle_trapdoor " , S ( " Jungle Trapdoor " ) , " mcl_doors_trapdoor_jungle.png " , " mcl_doors_trapdoor_jungle_side.png " , " mcl_core:junglewood " } ,
2017-11-24 13:07:16 +02:00
}
2017-06-05 22:57:23 +03:00
2017-11-24 13:07:16 +02:00
for w = 1 , # woods do
mcl_doors : register_trapdoor ( " mcl_doors: " .. woods [ w ] [ 1 ] , {
description = woods [ w ] [ 2 ] ,
2019-03-08 01:00:09 +02:00
_doc_items_longdesc = S ( " Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder. " ) ,
_doc_items_usagehelp = S ( " To open or close the trapdoor, rightclick it or send a redstone signal to it. " ) ,
2017-12-08 14:07:24 +02:00
tile_front = woods [ w ] [ 3 ] ,
2017-12-08 14:38:38 +02:00
tile_side = woods [ w ] [ 4 ] ,
2017-11-24 13:07:16 +02:00
wield_image = woods [ w ] [ 3 ] ,
2020-04-19 00:24:42 +03:00
groups = { handy = 1 , axey = 1 , mesecon_effector_on = 1 , material_wood = 1 , flammable =- 1 } ,
2017-11-24 13:07:16 +02:00
_mcl_hardness = 3 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 3 ,
2017-11-24 13:07:16 +02:00
sounds = mcl_sounds.node_sound_wood_defaults ( ) ,
} )
2017-06-05 22:57:23 +03:00
2017-11-24 13:07:16 +02:00
minetest.register_craft ( {
output = " mcl_doors: " .. woods [ w ] [ 1 ] .. " 2 " ,
recipe = {
2017-12-08 14:38:38 +02:00
{ woods [ w ] [ 5 ] , woods [ w ] [ 5 ] , woods [ w ] [ 5 ] } ,
{ woods [ w ] [ 5 ] , woods [ w ] [ 5 ] , woods [ w ] [ 5 ] } ,
2017-11-24 13:07:16 +02:00
}
} )
2017-06-05 22:57:23 +03:00
2017-11-24 13:07:16 +02:00
minetest.register_craft ( {
type = " fuel " ,
recipe = " mcl_doors: " .. woods [ w ] [ 1 ] ,
burntime = 15 ,
} )
end
2017-06-05 22:57:23 +03:00
mcl_doors : register_trapdoor ( " mcl_doors:iron_trapdoor " , {
2019-03-08 01:00:09 +02:00
description = S ( " Iron Trapdoor " ) ,
_doc_items_longdesc = S ( " Iron trapdoors are horizontal barriers which can only be opened and closed by redstone signals, but not by hand. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder. " ) ,
2017-12-08 14:07:24 +02:00
tile_front = " doors_trapdoor_steel.png " ,
2017-12-08 14:38:38 +02:00
tile_side = " doors_trapdoor_steel_side.png " ,
2017-07-17 14:22:46 +03:00
wield_image = " doors_trapdoor_steel.png " ,
2017-06-05 22:57:23 +03:00
groups = { pickaxey = 1 , mesecon_effector_on = 1 } ,
_mcl_hardness = 5 ,
2020-04-17 22:40:13 +03:00
_mcl_blast_resistance = 5 ,
2017-06-05 22:57:23 +03:00
sounds = mcl_sounds.node_sound_metal_defaults ( ) ,
sound_open = " doors_steel_door_open " ,
sound_close = " doors_steel_door_close " ,
only_redstone_can_open = true ,
} )
minetest.register_craft ( {
2021-05-29 17:12:33 +03:00
output = " mcl_doors:iron_trapdoor " ,
2017-06-05 22:57:23 +03:00
recipe = {
2021-05-29 17:12:33 +03:00
{ " mcl_core:iron_ingot " , " mcl_core:iron_ingot " } ,
{ " mcl_core:iron_ingot " , " mcl_core:iron_ingot " } ,
2017-06-05 22:57:23 +03:00
}
} )