2024-06-13 14:11:59 +02:00
|
|
|
local common_defs = {
|
|
|
|
doors = {
|
|
|
|
collision_box = {
|
2024-06-14 00:42:42 +02:00
|
|
|
fixed = {-0.5, -0.5, -0.3125, 0.5, 1.5, -0.5},
|
2024-06-13 14:11:59 +02:00
|
|
|
type = "fixed"
|
|
|
|
},
|
|
|
|
drawtype = "mesh",
|
|
|
|
groups = {door = 1, redstone_blocks = 1},
|
|
|
|
mesh = "utility_door.obj",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "4dir",
|
|
|
|
selection_box = {
|
2024-06-14 00:42:42 +02:00
|
|
|
fixed = {-0.5, -0.5, -0.3125, 0.5, 1.5, -0.5},
|
2024-06-13 14:11:59 +02:00
|
|
|
type = "fixed"
|
|
|
|
},
|
|
|
|
sunlight_propagates = true,
|
|
|
|
use_texture_alpha = "clip"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-13 18:36:37 +02:00
|
|
|
local function set_door_tiles(identifier, side_tiles, alternative_tiles)
|
|
|
|
local side_tiles_name = ""
|
|
|
|
|
|
|
|
if side_tiles then
|
|
|
|
side_tiles_name = "utility_"..identifier.."_door_side.png"
|
|
|
|
elseif alternative_tiles then
|
|
|
|
side_tiles_name = alternative_tiles
|
|
|
|
end
|
|
|
|
|
|
|
|
return {
|
|
|
|
{
|
|
|
|
backface_culling = true,
|
|
|
|
name = "[combine:48x32:0,0=utility_"..identifier.."_door_top.png:"..
|
|
|
|
"0,16=utility_"..identifier.."_door_bottom.png:16,0="..side_tiles_name..
|
|
|
|
":16,16="..side_tiles_name..":32,0="..side_tiles_name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2024-06-13 22:24:00 +02:00
|
|
|
local function set_images(identifier, definitions)
|
|
|
|
local image_name = ""
|
|
|
|
|
|
|
|
if not identifier:find("waxed") then
|
|
|
|
image_name = "utility_"..identifier.."_door.png"
|
|
|
|
else
|
|
|
|
image_name = ("utility_"..identifier.."_door.png"):gsub("waxed_", "")
|
|
|
|
end
|
|
|
|
|
|
|
|
definitions.inventory_image = image_name
|
|
|
|
definitions.wield_image = image_name
|
|
|
|
end
|
|
|
|
|
2024-06-13 14:11:59 +02:00
|
|
|
local doors = {
|
|
|
|
["acacia"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
|
|
|
tiles = set_door_tiles("acacia", false, "building_acacia_planks.png")
|
2024-06-13 18:36:37 +02:00
|
|
|
},
|
|
|
|
["bamboo"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("bamboo", false, "building_bamboo_planks.png")
|
2024-06-13 14:11:59 +02:00
|
|
|
},
|
|
|
|
["birch"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("birch", true, nil),
|
|
|
|
},
|
|
|
|
["cherry"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("cherry", false, "building_cherry_planks.png"),
|
|
|
|
},
|
2024-06-13 22:24:00 +02:00
|
|
|
["copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("copper", false, "building_cut_copper.png")
|
|
|
|
},
|
2024-06-13 18:36:37 +02:00
|
|
|
["crimson"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("crimson", false, "building_crimson_planks.png")
|
|
|
|
},
|
|
|
|
["dark_oak"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("dark_oak", false, "building_dark_oak_planks.png")
|
|
|
|
},
|
2024-06-13 22:24:00 +02:00
|
|
|
["exposed_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("exposed_copper", false, "building_exposed_cut_copper.png")
|
|
|
|
},
|
2024-06-14 00:42:42 +02:00
|
|
|
["iron"] = {
|
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
|
|
|
tiles = set_door_tiles("iron", false, "building_iron_block.png")
|
|
|
|
},
|
2024-06-13 18:36:37 +02:00
|
|
|
["jungle"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("jungle", true, nil)
|
|
|
|
},
|
|
|
|
["mangrove"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("mangrove", false, "building_mangrove_planks.png")
|
|
|
|
},
|
|
|
|
["oak"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("oak", false, "building_oak_planks.png")
|
|
|
|
},
|
2024-06-13 22:24:00 +02:00
|
|
|
["oxidized_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("oxidized_copper", false, "building_oxidized_cut_copper.png")
|
|
|
|
},
|
2024-06-13 18:36:37 +02:00
|
|
|
["spruce"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("spruce", false, "building_spruce_planks.png")
|
|
|
|
},
|
|
|
|
["warped"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
2024-06-13 18:36:37 +02:00
|
|
|
tiles = set_door_tiles("warped", false, "building_warped_planks.png")
|
2024-06-13 22:24:00 +02:00
|
|
|
},
|
|
|
|
["waxed_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("copper", false, "building_cut_copper.png")
|
|
|
|
},
|
|
|
|
["waxed_exposed_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("exposed_copper", false, "building_exposed_cut_copper.png")
|
|
|
|
},
|
|
|
|
["waxed_oxidized_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("oxidized_copper", false, "building_oxidized_cut_copper.png")
|
|
|
|
},
|
|
|
|
["waxed_weathered_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("weathered_copper", false, "building_weathered_cut_copper.png")
|
|
|
|
},
|
|
|
|
["weathered_copper"] = {
|
2024-06-14 00:42:42 +02:00
|
|
|
sounds = mcl_sounds.node_sound_metal_defaults(),
|
2024-06-13 22:24:00 +02:00
|
|
|
tiles = set_door_tiles("weathered_copper", false, "building_weathered_cut_copper.png")
|
2024-06-13 14:11:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for identifier, definitions in pairs(doors) do
|
2024-06-13 22:24:00 +02:00
|
|
|
set_images(identifier, definitions)
|
2024-06-13 18:36:37 +02:00
|
|
|
|
2024-06-13 14:11:59 +02:00
|
|
|
voxelibre.register_block(identifier.."_door", table.merge(common_defs.doors, definitions))
|
|
|
|
end
|
2024-06-14 00:42:42 +02:00
|
|
|
|
|
|
|
for identifier, definitions in pairs(doors) do
|
|
|
|
definitions.mesh = "utility_door_left.obj"
|
|
|
|
|
|
|
|
set_images(identifier, definitions)
|
|
|
|
|
|
|
|
voxelibre.register_block(identifier.."_door_left", table.merge(common_defs.doors, definitions))
|
|
|
|
end
|