forked from VoxeLibre/VoxeLibre
More doors
This commit is contained in:
parent
792c40d7ec
commit
95dc308827
|
@ -26,7 +26,7 @@ local items = {
|
||||||
["honeycomb"] = {
|
["honeycomb"] = {
|
||||||
groups = {ingredients = 1},
|
groups = {ingredients = 1},
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if not placer or pointed_thing.type ~= "node" then
|
if not placer then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
local common_defs = {
|
local common_defs = {
|
||||||
doors = {
|
doors = {
|
||||||
collision_box = {
|
collision_box = {
|
||||||
fixed = {-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
|
fixed = {-0.5, -0.5, 0.3125, 0.5, 1.5, 0.5},
|
||||||
type = "fixed"
|
type = "fixed"
|
||||||
},
|
},
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
|
@ -10,7 +10,7 @@ local common_defs = {
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "4dir",
|
paramtype2 = "4dir",
|
||||||
selection_box = {
|
selection_box = {
|
||||||
fixed = {-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
|
fixed = {-0.5, -0.5, 0.3125, 0.5, 1.5, 0.5},
|
||||||
type = "fixed"
|
type = "fixed"
|
||||||
},
|
},
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
|
@ -37,6 +37,19 @@ local function set_door_tiles(identifier, side_tiles, alternative_tiles)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
local doors = {
|
local doors = {
|
||||||
["acacia"] = {
|
["acacia"] = {
|
||||||
tiles = set_door_tiles("acacia", false, "building_acacia_planks.png"),
|
tiles = set_door_tiles("acacia", false, "building_acacia_planks.png"),
|
||||||
|
@ -50,12 +63,18 @@ local doors = {
|
||||||
["cherry"] = {
|
["cherry"] = {
|
||||||
tiles = set_door_tiles("cherry", false, "building_cherry_planks.png"),
|
tiles = set_door_tiles("cherry", false, "building_cherry_planks.png"),
|
||||||
},
|
},
|
||||||
|
["copper"] = {
|
||||||
|
tiles = set_door_tiles("copper", false, "building_cut_copper.png")
|
||||||
|
},
|
||||||
["crimson"] = {
|
["crimson"] = {
|
||||||
tiles = set_door_tiles("crimson", false, "building_crimson_planks.png")
|
tiles = set_door_tiles("crimson", false, "building_crimson_planks.png")
|
||||||
},
|
},
|
||||||
["dark_oak"] = {
|
["dark_oak"] = {
|
||||||
tiles = set_door_tiles("dark_oak", false, "building_dark_oak_planks.png")
|
tiles = set_door_tiles("dark_oak", false, "building_dark_oak_planks.png")
|
||||||
},
|
},
|
||||||
|
["exposed_copper"] = {
|
||||||
|
tiles = set_door_tiles("exposed_copper", false, "building_exposed_cut_copper.png")
|
||||||
|
},
|
||||||
["jungle"] = {
|
["jungle"] = {
|
||||||
tiles = set_door_tiles("jungle", true, nil)
|
tiles = set_door_tiles("jungle", true, nil)
|
||||||
},
|
},
|
||||||
|
@ -65,17 +84,34 @@ local doors = {
|
||||||
["oak"] = {
|
["oak"] = {
|
||||||
tiles = set_door_tiles("oak", false, "building_oak_planks.png")
|
tiles = set_door_tiles("oak", false, "building_oak_planks.png")
|
||||||
},
|
},
|
||||||
|
["oxidized_copper"] = {
|
||||||
|
tiles = set_door_tiles("oxidized_copper", false, "building_oxidized_cut_copper.png")
|
||||||
|
},
|
||||||
["spruce"] = {
|
["spruce"] = {
|
||||||
tiles = set_door_tiles("spruce", false, "building_spruce_planks.png")
|
tiles = set_door_tiles("spruce", false, "building_spruce_planks.png")
|
||||||
},
|
},
|
||||||
["warped"] = {
|
["warped"] = {
|
||||||
tiles = set_door_tiles("warped", false, "building_warped_planks.png")
|
tiles = set_door_tiles("warped", false, "building_warped_planks.png")
|
||||||
|
},
|
||||||
|
["waxed_copper"] = {
|
||||||
|
tiles = set_door_tiles("copper", false, "building_cut_copper.png")
|
||||||
|
},
|
||||||
|
["waxed_exposed_copper"] = {
|
||||||
|
tiles = set_door_tiles("exposed_copper", false, "building_exposed_cut_copper.png")
|
||||||
|
},
|
||||||
|
["waxed_oxidized_copper"] = {
|
||||||
|
tiles = set_door_tiles("oxidized_copper", false, "building_oxidized_cut_copper.png")
|
||||||
|
},
|
||||||
|
["waxed_weathered_copper"] = {
|
||||||
|
tiles = set_door_tiles("weathered_copper", false, "building_weathered_cut_copper.png")
|
||||||
|
},
|
||||||
|
["weathered_copper"] = {
|
||||||
|
tiles = set_door_tiles("weathered_copper", false, "building_weathered_cut_copper.png")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for identifier, definitions in pairs(doors) do
|
for identifier, definitions in pairs(doors) do
|
||||||
definitions.inventory_image = "utility_"..identifier.."_door.png"
|
set_images(identifier, definitions)
|
||||||
definitions.wield_image = "utility_"..identifier.."_door.png"
|
|
||||||
|
|
||||||
voxelibre.register_block(identifier.."_door", table.merge(common_defs.doors, definitions))
|
voxelibre.register_block(identifier.."_door", table.merge(common_defs.doors, definitions))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue