123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610 |
- walls = {}
- walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sounds)
- local register_node = function(name, def)
- local ndef = table.copy(def)
- stairs.setup_nodedef_callbacks(name, ndef)
- minetest.register_node(name, ndef)
- end
- -- inventory node, and pole-type wall start item
- register_node(":walls:" .. wall_name, {
- description = wall_desc .. " Wall",
- drawtype = "nodebox",
- node_box = {
- type = "connected",
- fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
- -- connect_bottom =
- connect_front = {{-3/16, -1/2, -1/2, 3/16, 3/8, -1/4}},
- connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8, 3/16}},
- connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}},
- connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}},
- },
- -- Connect to pillars too -- lets players screwdriver a pillar sideways and use it as a wall post, or something.
- connects_to = { "group:wall", "group:stone", "group:brick", "group:rackstone", "group:pillar" },
- paramtype = "light",
- is_ground_content = false,
- tiles = { wall_texture },
- walkable = true,
- -- Must be in group:wall otherwise walls will not connect.
- groups = utility.dig_groups("wall", {wall = 1}),
- sounds = wall_sounds,
- })
- register_node(":walls:" .. wall_name .. "_noconnect", {
- description = wall_desc .. " Pillar",
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
- },
- paramtype = "light",
- paramtype2 = "facedir",
- --is_ground_content = false,
- tiles = { wall_texture },
- walkable = true,
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- })
- register_node(":walls:" .. wall_name .. "_noconnect_wide", {
- description = wall_desc .. " Wide Pillar",
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {{-0.5, -0.5, -0.25, 0.5, 0.5, 0.25}},
- },
- paramtype = "light",
- paramtype2 = "facedir",
- is_ground_content = false,
- tiles = { wall_texture },
- walkable = true,
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- })
- minetest.register_craft({
- output = "walls:" .. wall_name .. "_noconnect",
- recipe = {
- {'walls:' .. wall_name},
- {'walls:' .. wall_name},
- },
- })
- minetest.register_craft({
- output = "walls:" .. wall_name .. "_noconnect_wide",
- recipe = {
- {'walls:' .. wall_name .. "_noconnect"},
- {'walls:' .. wall_name .. "_noconnect"},
- },
- })
- register_node(":walls:" .. wall_name .. "_half", {
- drawtype = "nodebox",
- description = wall_desc .. " Half Wall",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.25, -0.5, 0.25, 0.25, 0.5, 0.5},
- },
- },
- })
- -- crafting recipe
- minetest.register_craft({
- output = "walls:" .. wall_name .. " 6",
- recipe = {
- { '', '', '' },
- { wall_mat, wall_mat, wall_mat},
- { wall_mat, wall_mat, wall_mat},
- }
- })
- minetest.register_craft({
- output = "walls:"..wall_name.."_half 2",
- type="shapeless",
- recipe = {"walls:"..wall_name},
- })
- minetest.register_craft({
- output = "walls:"..wall_name,
- type="shapeless",
- recipe = {"walls:"..wall_name.."_half", "walls:"..wall_name.."_half"},
- })
- -- pillars
- register_node(":pillars:" .. wall_name .. "_bottom", {
- drawtype = "nodebox",
- description = wall_desc .. " Pillar Base",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall", {pillar = 1}),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5,-0.5,-0.5,0.5,-0.375,0.5},
- {-0.375,-0.375,-0.375,0.375,-0.125,0.375},
- {-0.25,-0.125,-0.25,0.25,0.5,0.25},
- },
- },
- })
- register_node(":pillars:" .. wall_name .. "_bottom_half", {
- drawtype = "nodebox",
- description = wall_desc .. " Half Pillar Base",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
- {-0.375, -0.375, 0.125, 0.375, -0.125, 0.5},
- {-0.25, -0.125, 0.25, 0.25, 0.5, 0.5},
- },
- },
- })
-
- register_node(":pillars:" .. wall_name .. "_top", {
- drawtype = "nodebox",
- description = wall_desc .. " Pillar Top",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall", {pillar = 1}),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5,0.3125,-0.5,0.5,0.5,0.5},
- {-0.375,0.0625,-0.375,0.375,0.3125,0.375},
- {-0.25,-0.5,-0.25,0.25,0.0625,0.25},
- },
- },
- })
- register_node(":pillars:" .. wall_name .. "_top_half", {
- drawtype = "nodebox",
- description = wall_desc .. " Half Pillar Top",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, 0.3125, 0, 0.5, 0.5, 0.5},
- {-0.375, 0.0625, 0.125, 0.375, 0.3125, 0.5},
- {-0.25, -0.5, 0.25, 0.25, 0.0625, 0.5},
- },
- },
- })
- register_node(":pillars:" .. wall_name .. "_bottom_full", {
- drawtype = "nodebox",
- description = wall_desc .. " Wide Pillar Base",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
- {-0.375, -0.375, -0.5, 0.375, -0.125, 0.5},
- {-0.25, -0.125, -0.5, 0.25, 0.5, 0.5},
- },
- },
- })
- register_node(":pillars:" .. wall_name .. "_bottom_back", {
- drawtype = "nodebox",
- description = wall_desc .. " Wide Pillar Base",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, -- NodeBox4
- {-0.5, -0.375, -0.375, 0.5, -0.125, 0.5}, -- NodeBox5
- {-0.5, -0.125, -0.25, 0.5, 0.5, 0.5}, -- NodeBox6
- },
- },
- })
- register_node(":pillars:" .. wall_name .. "_top_full", {
- drawtype = "nodebox",
- description = wall_desc .. " Wide Pillar Top",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5},
- {-0.5, 0.125, -0.375, 0.5, 0.375, 0.375},
- {-0.5, -0.5, -0.25, 0.5, 0.5, 0.25},
- },
- },
- })
- register_node(":pillars:" .. wall_name .. "_top_back", {
- drawtype = "nodebox",
- description = wall_desc .. " Wide Pillar Top",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
- {-0.5, 0.125, -0.375, 0.5, 0.375, 0.5}, -- NodeBox2
- {-0.5, -0.5, -0.25, 0.5, 0.125, 0.5}, -- NodeBox3
- },
- },
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_bottom 4",
- recipe = {
- {"",wall_mat,""},
- {"",wall_mat,""},
- {wall_mat,wall_mat,wall_mat},
- },
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_top 4",
- recipe = {
- {wall_mat,wall_mat,wall_mat},
- {"",wall_mat,""},
- {"",wall_mat,""},
- },
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_top_half 2",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_top"},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_top",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_top_half", "pillars:"..wall_name.."_top_half"},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_top_full",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_top", "pillars:"..wall_name.."_top_half"},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_top_back",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_top_full", "walls:" .. wall_name},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_bottom_half 2",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_bottom"},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_bottom",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_bottom_half", "pillars:"..wall_name.."_bottom_half"},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_bottom_full",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_bottom", "pillars:"..wall_name.."_bottom_half"},
- })
- minetest.register_craft({
- output = "pillars:"..wall_name.."_bottom_back",
- type="shapeless",
- recipe = {"pillars:"..wall_name.."_bottom_full", "walls:" .. wall_name},
- })
-
- register_node(":murderhole:" .. wall_name, {
- drawtype = "nodebox",
- description = wall_desc .. " Murder Hole",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-8/16,-8/16,-8/16,-4/16,8/16,8/16},
- {4/16,-8/16,-8/16,8/16,8/16,8/16},
- {-4/16,-8/16,-8/16,4/16,8/16,-4/16},
- {-4/16,-8/16,8/16,4/16,8/16,4/16},
- },
- },
- })
-
- register_node(":machicolation:" .. wall_name, {
- drawtype = "nodebox",
- description = wall_desc .. " Machicolation",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, 0, -0.5, 0.5, 0.5, 0},
- {-0.5, -0.5, 0, -0.25, 0.5, 0.5},
- {0.25, -0.5, 0, 0.5, 0.5, 0.5},
- },
- },
- })
- minetest.register_craft({
- output = "murderhole:"..wall_name.." 4",
- recipe = {
- {"",wall_mat, "" },
- {wall_mat,"", wall_mat},
- {"",wall_mat, ""}
- },
- })
- minetest.register_craft({
- output = "machicolation:"..wall_name,
- type="shapeless",
- recipe = {"murderhole:"..wall_name},
- })
- minetest.register_craft({
- output = "murderhole:"..wall_name,
- type="shapeless",
- recipe = {"machicolation:"..wall_name},
- })
-
- -- arrow slits
- register_node(":arrowslit:"..wall_name, {
- drawtype = "nodebox",
- description = wall_desc .. " Arrowslit",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.375, 0.5, -0.0625, 0.375, 0.3125},
- {0.0625, -0.375, 0.5, 0.5, 0.375, 0.3125},
- {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125},
- {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125},
- {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125},
- {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125},
- },
- },
- })
- register_node(":arrowslit:"..wall_name.."_cross", {
- drawtype = "nodebox",
- description = wall_desc .. " Arrowslit With Cross",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.125, 0.5, -0.0625, 0.375, 0.3125},
- {0.0625, -0.125, 0.5, 0.5, 0.375, 0.3125},
- {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125},
- {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125},
- {0.0625, -0.375, 0.5, 0.5, -0.25, 0.3125},
- {-0.5, -0.375, 0.5, -0.0625, -0.25, 0.3125},
- {-0.5, -0.25, 0.5, -0.1875, -0.125, 0.3125},
- {0.1875, -0.25, 0.5, 0.5, -0.125, 0.3125},
- {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125},
- {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125},
- },
- },
- })
- register_node(":arrowslit:"..wall_name.."_hole", {
- drawtype = "nodebox",
- description = wall_desc .. " Arrowslit With Hole",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.375, 0.5, -0.125, 0.375, 0.3125},
- {0.125, -0.375, 0.5, 0.5, 0.375, 0.3125},
- {-0.5, -0.5, 0.5, 0.5, -0.375, 0.3125},
- {0.0625, -0.125, 0.5, 0.125, 0.375, 0.3125},
- {-0.125, -0.125, 0.5, -0.0625, 0.375, 0.3125},
- {-0.5, 0.375, 0.5, 0.5, 0.5, 0.3125},
- {0.25, -0.5, 0.3125, 0.5, 0.5, 0.125},
- {-0.5, -0.5, 0.3125, -0.25, 0.5, 0.125},
- },
- },
- })
- register_node(":arrowslit:"..wall_name.."_embrasure", {
- drawtype = "nodebox",
- description = wall_desc .. " Embrasure",
- tiles = { wall_texture },
- groups = utility.dig_groups("wall"),
- sounds = wall_sounds,
- paramtype = "light",
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.25, -0.5, 0.375, -0.125, 0.5, 0.5},
- {0.125, -0.5, 0.375, 0.25, 0.5, 0.5},
- {0.25, -0.5, 0.25, 0.5, 0.5, 0.5},
- {0.375, -0.5, 0.125, 0.5, 0.5, 0.25},
- {-0.5, -0.5, 0.25, -0.25, 0.5, 0.5},
- {-0.5, -0.5, 0.125, -0.375, 0.5, 0.25},
- },
- },
- })
-
- minetest.register_craft({
- output = "arrowslit:"..wall_name.." 6",
- recipe = {
- {wall_mat,"",wall_mat},
- {wall_mat,"",wall_mat},
- {wall_mat,"",wall_mat},
- },
- })
- minetest.register_craft({
- output = "arrowslit:"..wall_name.."_cross",
- recipe = {
- {"arrowslit:"..wall_name} },
- })
- minetest.register_craft({
- output = "arrowslit:"..wall_name.."_hole",
- recipe = {
- {"arrowslit:"..wall_name.."_cross"} },
- })
- minetest.register_craft({
- output = "arrowslit:"..wall_name.."_embrasure",
- recipe = {
- {"arrowslit:"..wall_name.."_hole"} },
- })
- minetest.register_craft({
- output = "arrowslit:"..wall_name,
- recipe = {
- {"arrowslit:"..wall_name.."_embrasure"} },
- })
- end
- walls.register("cobble", "Cobblestone", "default_cobble.png",
- "default:cobble", default.node_sound_stone_defaults())
- walls.register("copper", "Copper Block", "default_copper_block.png",
- "default:copperblock", default.node_sound_metal_defaults())
- walls.register("steel", "Steel Block", "default_steel_block.png",
- "default:steelblock", default.node_sound_metal_defaults())
- walls.register("gold", "Gold Block", "default_gold_block.png",
- "default:goldblock", default.node_sound_metal_defaults())
- walls.register("bronze", "Bronze Block", "default_bronze_block.png",
- "default:bronzeblock", default.node_sound_metal_defaults())
- walls.register("tin", "Tin Block", "moreores_tin_block.png",
- "moreores:tin_block", default.node_sound_metal_defaults())
- walls.register("stone", "Stone", "default_stone.png",
- "default:stone", default.node_sound_stone_defaults())
- walls.register("stonebrick", "Stone Brick", "default_stone_brick.png",
- "default:stonebrick", default.node_sound_stone_defaults())
- walls.register("desert_stone", "Redstone", "default_desert_stone.png",
- "default:desert_stone", default.node_sound_stone_defaults())
- walls.register("sandstonebrick", "Sandstone Brick", "default_sandstone_brick.png",
- "default:sandstonebrick", default.node_sound_stone_defaults())
- walls.register("desert_stonebrick", "Redstone Brick", "default_desert_stone_brick.png",
- "default:desert_stonebrick", default.node_sound_stone_defaults())
- walls.register("sandstone", "Sandstone", "default_sandstone.png",
- "default:sandstone", default.node_sound_stone_defaults())
- walls.register("desert_sandstone", "Desert Sandstone", "default_desert_sandstone.png",
- "default:desert_sandstone", default.node_sound_stone_defaults())
- walls.register("silver_sandstone", "Silver Sandstone", "default_silver_sandstone.png",
- "default:silver_sandstone", default.node_sound_stone_defaults())
- walls.register("mossycobble", "Mossy Cobblestone", "default_mossycobble.png",
- "default:mossycobble", default.node_sound_stone_defaults())
- walls.register("desertcobble", "Chalked Cobble Redstone", "default_desert_cobble.png",
- "default:desert_cobble", default.node_sound_stone_defaults())
- walls.register("desertcobble2", "Cobble Redstone", "default_desert_cobble2.png",
- "default:desert_cobble2", default.node_sound_stone_defaults())
- walls.register("redrack", "Netherack", "rackstone_redrack.png",
- "rackstone:redrack", default.node_sound_stone_defaults())
- walls.register("redrack_cobble", "Cobbled Netherack", "rackstone_redrack_cobble.png",
- "rackstone:redrack_cobble", default.node_sound_stone_defaults())
- walls.register("redrack_brick", "Netherack Brick", "rackstone_brick.png",
- "rackstone:brick", default.node_sound_stone_defaults())
- walls.register("blackrack", "Blackrack", "rackstone_blackrack.png",
- "rackstone:blackrack", default.node_sound_stone_defaults())
- walls.register("bluerack", "Bluerack", "rackstone_bluerack.png",
- "rackstone:bluerack", default.node_sound_stone_defaults())
- walls.register("bluerack_brick", "Blue Rackstone Brick", "rackstone_bluerack_brick.png",
- "rackstone:bluerack_brick", default.node_sound_stone_defaults())
- walls.register("blackrack_brick", "Black Rackstone Brick", "rackstone_brick_black.png",
- "rackstone:brick_black", default.node_sound_stone_defaults())
- walls.register("rackstone_brick", "Rackstone Brick", "rackstone_rackstone_brick.png",
- "rackstone:rackstone_brick2", default.node_sound_stone_defaults())
- walls.register("rackstone", "Rackstone", "rackstone_rackstone.png",
- "rackstone:rackstone", default.node_sound_stone_defaults())
- walls.register("whitestone_brick", "Bleached Brick", "whitestone_brick.png",
- "whitestone:brick", default.node_sound_stone_defaults())
- walls.register("ice", "Ice", "default_ice.png",
- "default:ice", default.node_sound_glass_defaults())
- walls.register("snow_brick", "Snow Brick", "snow_bricks_snow_brick.png",
- "snow_bricks:snow_brick", default.node_sound_glass_defaults())
- walls.register("ice_brick", "Ice Brick", "snow_bricks_ice_brick.png",
- "snow_bricks:ice_brick", default.node_sound_glass_defaults())
- walls.register("lapis_cobble", "Cobbled Lapis", "lapis_cobble.png",
- "lapis:lapis_cobble", default.node_sound_stone_defaults())
- walls.register("obsidian", "Obsidian", "default_obsidian.png",
- "default:obsidian", default.node_sound_stone_defaults())
- walls.register("obsidian_brick", "Obsidian Brick", "default_obsidian_brick.png",
- "default:obsidianbrick", default.node_sound_stone_defaults())
- walls.register("rackstone_cobble", "Rackstone Cobble", "rackstone_rackstone_cobble.png",
- "rackstone:cobble", default.node_sound_stone_defaults())
|