123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939 |
- local S = gold_and_gem.gettext
- local border_block_materials = {
- { "golden", " with golden border"},
- { "mithril", " with Mithril-border" }
- }
- minetest.register_node("gold_and_gem:golden_mithril_block", {
- description = "Mithril Block with golden border",
- tiles = {"goldgem_golden_mithril_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:mithril_goldblock", {
- description = "Gold Block with Mithril-border",
- tiles = {"goldgem_mithril_gold_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- for i in ipairs(border_block_materials) do
- local border = border_block_materials[i][1]
- local name = border_block_materials[i][2]
- minetest.register_node("gold_and_gem:"..border.."_diamondblock", {
- description = "Diamond Block"..name,
- tiles = {"goldgem_"..border.."_diamond_block.png"},
- is_ground_content = false,
- groups = {cracky=1,level=3},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_glass", {
- description = "Glass"..name,
- drawtype = "glasslike",
- tiles = {"goldgem_"..border.."_glass.png"},
- paramtype = "light",
- inventory_image = minetest.inventorycube("goldgem_"..border.."_glass.png"),
- sunlight_propagates = true,
- is_ground_content = false,
- groups = {cracky=3,oddly_breakable_by_hand=3},
- sounds = default.node_sound_glass_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_silver_block", {
- description = "Silver Block"..name,
- tiles = {"goldgem_"..border.."_silver_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_amethystblock", {
- description = "Amethyst Block"..name,
- tiles = {"goldgem_"..border.."_amethyst_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_emeraldblock", {
- description = "Emerald Block"..name,
- tiles = {"goldgem_"..border.."_emerald_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_rubyblock", {
- description = "Ruby Block"..name,
- tiles = {"goldgem_"..border.."_ruby_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_sapphireblock", {
- description = "Sapphire Block"..name,
- tiles = {"goldgem_"..border.."_sapphire_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_topazblock", {
- description = "Topaz Block"..name,
- tiles = {"goldgem_"..border.."_topaz_block.png"},
- is_ground_content = false,
- groups = {bendy=3,cracky=2,level=1},
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_crystal_glass", {
- description = "Crystal Glass"..name,
- drawtype = "glasslike",
- inventory_image = minetest.inventorycube("goldgem_"..border.."_crystal_glass.png"),
- tiles = {"goldgem_"..border.."_crystal_glass.png"},
- paramtype = "light",
- sunlight_propagates = true,
- is_ground_content = false,
- groups = {cracky=3},
- sounds = default.node_sound_glass_defaults(),
- })
- minetest.register_node("gold_and_gem:"..border.."_taliniteblock", {
- description = "Talinite Block"..name,
- tiles = {"goldgem_"..border.."_talinite_block.png"},
- is_ground_content = false,
- light_source = 14,
- groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2},
- sounds = default.node_sound_stone_defaults(),
- })
- end
- local table_borders = {
- {"gold_glass","Gold"},
- {"mithril_glass","Mithril"},
- {"ruby_glass","Ruby"},
- {"emerald_glass","Emerald"}
- }
- for i in ipairs(table_borders) do
- local material = table_borders[i][1]
- local border = table_borders[i][2]
- -- small square tables
- minetest.register_node("gold_and_gem:"..material.."_table_small_square_b", {
- description = S("Glass Table (Small, Square) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_small_square_tb.png",
- "goldgem_"..material.."_table_small_square_tb.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png"
- },
- wield_image = "goldgem_"..material.."_table_small_square_tb.png",
- inventory_image = "goldgem_"..material.."_table_small_square_tb.png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3 },
- sounds = default.node_sound_glass_defaults(),
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- { -0.4375, -0.5, -0.5, 0.4375, -0.4375, 0.5 },
- { -0.5, -0.5, -0.4375, 0.5, -0.4375, 0.4375 }
- },
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
- },
- on_place = minetest.rotate_node
- })
- minetest.register_node("gold_and_gem:"..material.."_table_small_square_t", {
- description = S("Glass Table (Small, Square) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_small_square_tb.png",
- "goldgem_"..material.."_table_small_square_tb.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png"
- },
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3, not_in_creative_inventory=1 },
- sounds = default.node_sound_glass_defaults(),
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- { -0.4375, 0.4375, -0.5, 0.4375, 0.5, 0.5 },
- { -0.5, 0.4375, -0.4375, 0.5, 0.5, 0.4375 }
- },
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
- },
- drop = "gold_and_gem:"..material.."_table_small_square_b"
- })
- minetest.register_node("gold_and_gem:"..material.."_table_small_square_s", {
- description = S("Glass Table (Small, Square) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_edges.png",
- "goldgem_"..material.."_table_small_square_tb.png",
- "goldgem_"..material.."_table_small_square_tb.png"
- },
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3, not_in_creative_inventory=1 },
- sounds = default.node_sound_glass_defaults(),
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- { -0.4375, -0.5, 0.4375, 0.4375, 0.5, 0.5 },
- { -0.5, -0.4375, 0.4375, 0.5, 0.4375, 0.5 }
- }
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 },
- },
- drop = "gold_and_gem:"..material.."_table_small_square_b"
- })
- -- small round tables
- minetest.register_node("gold_and_gem:"..material.."_table_small_round_b", {
- description = S("Glass Table (Small, Round) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_small_round_tb.png",
- "goldgem_"..material.."_table_small_round_tb.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png"
- },
- wield_image = "goldgem_"..material.."_table_small_round_tb.png",
- inventory_image = "goldgem_"..material.."_table_small_round_tb.png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3 },
- sounds = default.node_sound_glass_defaults(),
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- { -0.25, -0.5, -0.5, 0.25, -0.4375, 0.5 },
- { -0.375, -0.5, -0.4375, 0.375, -0.4375, 0.4375 },
- { -0.5, -0.5, -0.25, 0.5, -0.4375, 0.25 },
- { -0.4375, -0.5, -0.375, 0.4375, -0.4375, 0.375 },
- { -0.25, -0.5, -0.5, 0.25, -0.4375, 0.5 },
- }
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
- },
- on_place = minetest.rotate_node
- })
- minetest.register_node("gold_and_gem:"..material.."_table_small_round_t", {
- description = S("Glass Table (Small, Round) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_small_round_tb.png",
- "goldgem_"..material.."_table_small_round_tb.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png"
- },
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3, not_in_creative_inventory=1 },
- sounds = default.node_sound_glass_defaults(),
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- { -0.25, 0.4375, -0.5, 0.25, 0.5, 0.5 },
- { -0.375, 0.4375, -0.4375, 0.375, 0.5, 0.4375 },
- { -0.5, 0.4375, -0.25, 0.5, 0.5, 0.25 },
- { -0.4375, 0.4375, -0.375, 0.4375, 0.5, 0.375 },
- { -0.25, 0.4375, -0.5, 0.25, 0.5, 0.5 },
- }
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
- },
- drop = "gold_and_gem:"..material.."_table_small_round_b"
- })
- minetest.register_node("gold_and_gem:"..material.."_table_small_round_s", {
- description = S("Glass Table (Small, Round) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_edges.png",
- "goldgem_"..material.."_table_small_round_tb.png",
- "goldgem_"..material.."_table_small_round_tb.png"
- },
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3, not_in_creative_inventory=1 },
- sounds = default.node_sound_glass_defaults(),
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = {
- { -0.25, -0.5, 0.4375, 0.25, 0.5, 0.5 },
- { -0.375, -0.4375, 0.4375, 0.375, 0.4375, 0.5 },
- { -0.5, -0.25, 0.4375, 0.5, 0.25, 0.5 },
- { -0.4375, -0.375, 0.4375, 0.4375, 0.375, 0.5 },
- { -0.25, -0.5, 0.4375, 0.25, 0.5, 0.5 },
- }
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 },
- },
- drop = "gold_and_gem:"..material.."_table_small_round_b"
- })
- -- Large square table pieces
- minetest.register_node("gold_and_gem:"..material.."_table_large_b", {
- description = S("Glass Table (Large) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_large_tb.png",
- "goldgem_"..material.."_table_large_tb.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png"
- },
- wield_image = "goldgem_"..material.."_table_large_tb.png",
- inventory_image = "goldgem_"..material.."_table_large_tb.png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3 },
- sounds = s,
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
- },
- on_place = minetest.rotate_node
- })
- minetest.register_node("gold_and_gem:"..material.."_table_large_t", {
- description = S("Glass Table (Large) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_large_tb.png",
- "goldgem_"..material.."_table_large_tb.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png"
- },
- wield_image ="goldgem_"..material.."_table_large_tb.png",
- inventory_image = "goldgem_"..material.."_table_large_tb.png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3, not_in_creative_inventory=1 },
- sounds = s,
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
- },
- drop = "goldgem_"..material.."_table_large_b"
- })
- minetest.register_node("gold_and_gem:"..material.."_table_large_s", {
- description = S("Glass Table (Large) with "..border.." Border"),
- drawtype = "nodebox",
- tiles = {
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_edges.png",
- "goldgem_"..material.."_table_large_tb.png",
- "goldgem_"..material.."_table_large_tb.png"
- },
- wield_image = "goldgem_"..material.."_table_large_tb.png",
- inventory_image = "goldgem_"..material.."_table_large_tb.png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = true,
- groups = { snappy = 3, not_in_creative_inventory=1 },
- sounds = s,
- paramtype2 = "facedir",
- node_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 },
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 },
- },
- drop ="goldgem_"..material.."_table_large_b"
- })
- minetest.register_alias("gold_and_gem_"..material.."_table_large","gold_and_gem_"..material.."_table_large_b")
- minetest.register_alias("gold_and_gem_"..material.."_table_small_square","gold_and_gem_"..material.."_table_small_square_b")
- minetest.register_alias("gold_and_gem_"..material.."_table_small_round", "gold_and_gem_"..material.."_table_small_round_b")
- end
- local function placeRubyLamp(itemstack, placer, pointed_thing)
- if pointed_thing.type ~= "node" then
- return itemstack
- end
- local p0 = pointed_thing.under
- local p1 = pointed_thing.above
- local param2 = 0
- local dir = {
- x = p1.x - p0.x,
- y = p1.y - p0.y,
- z = p1.z - p0.z
- }
- param2 = minetest.dir_to_facedir(dir,false)
- local correct_rotation={
- [0]=0,
- [1]=1,
- [2]=2,
- [3]=3
- }
- if p0.y == p1.y then
- --place torch on wall
- minetest.add_node(p1, {name="gold_and_gem:ruby_lamp_wall",param2=correct_rotation[param2]})
- else
- --place torch on floor
- minetest.add_node(p1, {name="gold_and_gem:ruby_lamp"})
- --return minetest.item_place(itemstack, placer, pointed_thing, param2)
- end
- itemstack:take_item()
- return itemstack
-
- end
- local function placeEmeraldLamp(itemstack, placer, pointed_thing)
- if pointed_thing.type ~= "node" then
- return itemstack
- end
- local p0 = pointed_thing.under
- local p1 = pointed_thing.above
- local param2 = 0
- local dir = {
- x = p1.x - p0.x,
- y = p1.y - p0.y,
- z = p1.z - p0.z
- }
- param2 = minetest.dir_to_facedir(dir,false)
- local correct_rotation={
- [0]=0,
- [1]=1,
- [2]=2,
- [3]=3
- }
- if p0.y == p1.y then
- --place torch on wall
- minetest.add_node(p1, {name="gold_and_gem:emerald_lamp_wall",param2=correct_rotation[param2]})
- else
- --place torch on floor
- minetest.add_node(p1, {name="gold_and_gem:emerald_lamp"})
- --return minetest.item_place(itemstack, placer, pointed_thing, param2)
- end
- itemstack:take_item()
- return itemstack
-
- end
- local function placeTopazLamp(itemstack, placer, pointed_thing)
- if pointed_thing.type ~= "node" then
- return itemstack
- end
- local p0 = pointed_thing.under
- local p1 = pointed_thing.above
- local param2 = 0
- local dir = {
- x = p1.x - p0.x,
- y = p1.y - p0.y,
- z = p1.z - p0.z
- }
- param2 = minetest.dir_to_facedir(dir,false)
- local correct_rotation={
- [0]=0,
- [1]=1,
- [2]=2,
- [3]=3
- }
- if p0.y == p1.y then
- --place torch on wall
- minetest.add_node(p1, {name="gold_and_gem:topaz_lamp_wall",param2=correct_rotation[param2]})
- else
- --place torch on floor
- minetest.add_node(p1, {name="gold_and_gem:topaz_lamp"})
- --return minetest.item_place(itemstack, placer, pointed_thing, param2)
- end
- itemstack:take_item()
- return itemstack
-
- end
- local function placeSapphireLamp(itemstack, placer, pointed_thing)
- if pointed_thing.type ~= "node" then
- return itemstack
- end
- local p0 = pointed_thing.under
- local p1 = pointed_thing.above
- local param2 = 0
- local dir = {
- x = p1.x - p0.x,
- y = p1.y - p0.y,
- z = p1.z - p0.z
- }
- param2 = minetest.dir_to_facedir(dir,false)
- local correct_rotation={
- [0]=0,
- [1]=1,
- [2]=2,
- [3]=3
- }
- if p0.y == p1.y then
- --place torch on wall
- minetest.add_node(p1, {name="gold_and_gem:sapphire_lamp_wall",param2=correct_rotation[param2]})
- else
- --place torch on floor
- minetest.add_node(p1, {name="gold_and_gem:sapphire_lamp"})
- --return minetest.item_place(itemstack, placer, pointed_thing, param2)
- end
- itemstack:take_item()
- return itemstack
-
- end
- local function placeAmethystLamp(itemstack, placer, pointed_thing)
- if pointed_thing.type ~= "node" then
- return itemstack
- end
- local p0 = pointed_thing.under
- local p1 = pointed_thing.above
- local param2 = 0
- local dir = {
- x = p1.x - p0.x,
- y = p1.y - p0.y,
- z = p1.z - p0.z
- }
- param2 = minetest.dir_to_facedir(dir,false)
- local correct_rotation={
- [0]=0,
- [1]=1,
- [2]=2,
- [3]=3
- }
- if p0.y == p1.y then
- --place torch on wall
- minetest.add_node(p1, {name="gold_and_gem:amethyst_lamp_wall",param2=correct_rotation[param2]})
- else
- --place torch on floor
- minetest.add_node(p1, {name="gold_and_gem:amethyst_lamp"})
- --return minetest.item_place(itemstack, placer, pointed_thing, param2)
- end
- itemstack:take_item()
- return itemstack
-
- end
- local gemlamps = {
- {"ruby_lamp","Ruby Lamp",placeRubyLamp},
- {"amethyst_lamp","Amethyst Lamp", placeAmethystLamp},
- {"emerald_lamp","Emerald Lamp", placeEmeraldLamp},
- {"sapphire_lamp","Sapphire Lamp", placeSapphireLamp},
- {"topaz_lamp","Topaz Lamp", placeTopazLamp}
- }
- for i in ipairs(gemlamps) do
- local lamp = gemlamps[i][1]
- local lamp_name = gemlamps[i][2]
- local l_func = gemlamps[i][3]
- minetest.register_node("gold_and_gem:"..lamp, {
- description = lamp_name,
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.125, -0.5, -0.25, 0.125, -0.4375, 0.25}, -- NodeBox1
- {-0.25, -0.5, -0.125, 0.25, -0.4375, 0.125}, -- NodeBox2
- {-0.1875, -0.5, -0.1875, 0.1875, -0.4375, 0.1875}, -- NodeBox3
- {-0.125, -0.4375, -0.1875, 0.125, -0.375, 0.1875}, -- NodeBox4
- {-0.1875, -0.4375, -0.125, 0.1875, -0.375, 0.125}, -- NodeBox5
- {-0.0625, -0.375, -0.0625, 0.0625, -0.0625, 0.0625}, -- NodeBox6
- {-0.125, -0.0625, -0.125, 0.125, 0.0625, 0.125}, -- NodeBox7
- {-0.25, 0.0625, -0.25, 0.25, 0.25, 0.25}, -- NodeBox8
- {-0.125, 0.0625, -0.3125, 0.125, 0.25, 0.3125}, -- NodeBox9
- {-0.3125, 0.0625, -0.125, 0.3125, 0.25, 0.125}, -- NodeBox10
- {-0.125, 0.25, 0.25, 0.125, 0.5, 0.375}, -- NodeBox11
- {-0.375, 0.25, -0.125, -0.25, 0.5, 0.125}, -- NodeBox12
- {-0.125, 0.25, -0.375, 0.125, 0.5, -0.25}, -- NodeBox13
- {0.25, 0.25, -0.125, 0.375, 0.5, 0.125}, -- NodeBox14
- {0.125, 0.25, -0.3125, 0.25, 0.5, -0.1875}, -- NodeBox15
- {0.1875, 0.25, -0.25, 0.3125, 0.5, -0.125}, -- NodeBox16
- {-0.25, 0.25, -0.3125, -0.125, 0.5, -0.1875}, -- NodeBox17
- {-0.3125, 0.25, -0.25, -0.1875, 0.5, -0.125}, -- NodeBox18
- {-0.3125, 0.25, 0.125, -0.1875, 0.5, 0.25}, -- NodeBox19
- {-0.25, 0.25, 0.1875, -0.125, 0.5, 0.3125}, -- NodeBox20
- {0.1875, 0.25, 0.125, 0.3125, 0.5, 0.25}, -- NodeBox21
- {0.125, 0.25, 0.1875, 0.25, 0.5, 0.3125}, -- NodeBox22
- }
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.4, -0.5, -0.4, 0.4, 0.5, 0.4 },
- },
- tiles = {
- {name="goldgem_"..lamp.."_top_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}},
- {name="goldgem_"..lamp.."_bottom_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}},
- {name="goldgem_"..lamp.."_side_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
- },
- paramtype = "light",
- on_place = l_func,
- sunlight_propagates = true,
- is_ground_content = false,
- light_source = 12,
- groups = {choppy=2,dig_immediate=3},
- --legacy_wallmounted = true,
- sounds = default.node_sound_defaults(),
- })
- minetest.register_node("gold_and_gem:"..lamp.."_wall", {
- description = lamp_name.." Wall",
- drawtype = "nodebox",
- node_box = {
- type = "fixed",
- fixed = {
- {-0.0625, -0.1875, -0.0625, 0.0625, -0.0625, 0.0625}, -- NodeBox6
- {-0.125, -0.0625, -0.125, 0.125, 0.0625, 0.125}, -- NodeBox7
- {-0.25, 0.0625, -0.25, 0.25, 0.25, 0.25}, -- NodeBox8
- {-0.125, 0.0625, -0.3125, 0.125, 0.25, 0.3125}, -- NodeBox9
- {-0.3125, 0.0625, -0.125, 0.3125, 0.25, 0.125}, -- NodeBox10
- {-0.125, 0.25, 0.25, 0.125, 0.5, 0.375}, -- NodeBox11
- {-0.375, 0.25, -0.125, -0.25, 0.5, 0.125}, -- NodeBox12
- {-0.125, 0.25, -0.375, 0.125, 0.5, -0.25}, -- NodeBox13
- {0.25, 0.25, -0.125, 0.375, 0.5, 0.125}, -- NodeBox14
- {0.125, 0.25, -0.3125, 0.25, 0.5, -0.1875}, -- NodeBox15
- {0.1875, 0.25, -0.25, 0.3125, 0.5, -0.125}, -- NodeBox16
- {-0.25, 0.25, -0.3125, -0.125, 0.5, -0.1875}, -- NodeBox17
- {-0.3125, 0.25, -0.25, -0.1875, 0.5, -0.125}, -- NodeBox18
- {-0.3125, 0.25, 0.125, -0.1875, 0.5, 0.25}, -- NodeBox19
- {-0.25, 0.25, 0.1875, -0.125, 0.5, 0.3125}, -- NodeBox20
- {0.1875, 0.25, 0.125, 0.3125, 0.5, 0.25}, -- NodeBox21
- {0.125, 0.25, 0.1875, 0.25, 0.5, 0.3125}, -- NodeBox22
- {-0.0625, -0.25, -0.125, 0.0625, -0.125, 0}, -- NodeBox24
- {-0.0625, -0.3125, -0.25, 0.0625, -0.1875, -0.0625}, -- NodeBox25
- {-0.0625, -0.375, -0.375, 0.0625, -0.25, -0.1875}, -- NodeBox26
- {-0.125, -0.4375, -0.5, 0.125, -0.1875, -0.375}, -- NodeBox27
- {-0.125, -0.5, -0.5, 0.125, -0.125, -0.4375}, -- NodeBox28
- {-0.1875, -0.4375, -0.5, 0.1875, -0.1875, -0.4375}, -- NodeBox29
- }
- },
- selection_box = {
- type = "fixed",
- fixed = { -0.4, -0.5, -0.4, 0.4, 0.5, 0.4 },
- },
- tiles = {
- {name="goldgem_"..lamp.."_top_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}},
- {name="goldgem_"..lamp.."_wall_bottom_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}},
- {name="goldgem_"..lamp.."_side_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
- },
- paramtype = "light",
- on_place = l_func,
- paramtype2 = "facedir",
- sunlight_propagates = true,
- is_ground_content = false,
- light_source = 12,
- groups = {choppy=2,dig_immediate=3, not_in_creative_inventory=1},
- --legacy_wallmounted = true,
- sounds = default.node_sound_defaults(),
- drop ="gold_and_gem:"..lamp
- })
- end
- minetest.register_node("gold_and_gem:pillar", {
- tiles = {
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png"
- },
- description = "Marble Pillar",
- drawtype = "nodebox",
- paramtype = "light",
- is_ground_content = true,
- groups = {cracky=3},
- sounds = default.node_sound_stone_defaults(),
- node_box = {
- type = "fixed",
- fixed = {
- {-0.375, -0.5, -0.125, 0.375, 0.5, 0.125}, -- pillar_1
- {-0.125, -0.5, -0.375, 0.125, 0.5, 0.375}, -- pillar_2
- {-0.25, -0.5, -0.3125, 0.25, 0.5, 0.3125}, -- pillar_3
- {-0.3125, -0.5, -0.25, 0.3125, 0.5, 0.25}, -- pillar_4
- }
- }
- })
- minetest.register_node("gold_and_gem:pillar_ground", {
- tiles = {
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png"
- },
- description = "Marble Pillar Ground",
- drawtype = "nodebox",
- paramtype = "light",
- is_ground_content = true,
- groups = {cracky=3},
- sounds = default.node_sound_stone_defaults(),
- node_box = {
- type = "fixed",
- fixed = {
- {-0.375, -0.5, -0.125, 0.375, 0.5, 0.125}, -- pillar_1
- {-0.125, -0.5, -0.375, 0.125, 0.5, 0.375}, -- pillar_2
- {-0.25, -0.5, -0.3125, 0.25, 0.5, 0.3125}, -- pillar_3
- {-0.3125, -0.5, -0.25, 0.3125, 0.5, 0.25}, -- pillar_4
- {-0.4375, -0.4375, -0.4375, 0.4375, -0.375, 0.4375}, -- ground_1
- {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- ground_2
- }
- }
- })
- minetest.register_node("gold_and_gem:pillar_top", {
- tiles = {
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png",
- "technic_marble.png"
- },
- description = "Marble Pillar Top",
- drawtype = "nodebox",
- paramtype = "light",
- is_ground_content = true,
- groups = {cracky=3},
- sounds = default.node_sound_stone_defaults(),
- node_box = {
- type = "fixed",
- fixed = {
- {-0.375, -0.5, -0.125, 0.375, 0.5, 0.125}, -- pillar_1
- {-0.125, -0.5, -0.375, 0.125, 0.5, 0.375}, -- pillar_2
- {-0.25, -0.5, -0.3125, 0.25, 0.5, 0.3125}, -- pillar_3
- {-0.3125, -0.5, -0.25, 0.3125, 0.5, 0.25}, -- pillar_4
- {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- top_1
- {-0.4375, 0.375, -0.4375, 0.4375, 0.4375, 0.4375}, -- top_2
- }
- }
- })
- local mats = {
- {"gold","Gold"},
- {"silver","Silver"}
- }
- for i in ipairs(mats) do
- local mat = mats[i][1]
- local name = mats[i][2]
- minetest.register_node("gold_and_gem:pillar_"..mat, {
- tiles = {
- "technic_marble.png",
- "technic_marble.png",
- "goldgem_pillar_front_"..mat..".png",
- "goldgem_pillar_back_"..mat..".png",
- "goldgem_pillar_right_"..mat..".png",
- "goldgem_pillar_left_"..mat..".png"
- },
- description = "Marble Pillar "..name,
- drawtype = "nodebox",
- paramtype = "light",
- is_ground_content = true,
- groups = {cracky=3},
- sounds = default.node_sound_stone_defaults(),
- node_box = {
- type = "fixed",
- fixed = {
- {-0.375, -0.5, -0.125, 0.375, 0.5, 0.125}, -- pillar_1
- {-0.125, -0.5, -0.375, 0.125, 0.5, 0.375}, -- pillar_2
- {-0.25, -0.5, -0.3125, 0.25, 0.5, 0.3125}, -- pillar_3
- {-0.3125, -0.5, -0.25, 0.3125, 0.5, 0.25}, -- pillar_4
- }
- }
- })
- minetest.register_node("gold_and_gem:pillar_ground_"..mat, {
- tiles = {
- "technic_marble.png",
- "technic_marble.png",
- "goldgem_pillar_front_"..mat.."_bottom.png",
- "goldgem_pillar_back_"..mat.."_bottom.png",
- "goldgem_pillar_right_"..mat.."_bottom.png",
- "goldgem_pillar_left_"..mat..".png"
- },
- description = "Marble Pillar Ground "..name,
- drawtype = "nodebox",
- paramtype = "light",
- is_ground_content = true,
- groups = {cracky=3},
- sounds = default.node_sound_stone_defaults(),
- node_box = {
- type = "fixed",
- fixed = {
- {-0.375, -0.5, -0.125, 0.375, 0.5, 0.125}, -- pillar_1
- {-0.125, -0.5, -0.375, 0.125, 0.5, 0.375}, -- pillar_2
- {-0.25, -0.5, -0.3125, 0.25, 0.5, 0.3125}, -- pillar_3
- {-0.3125, -0.5, -0.25, 0.3125, 0.5, 0.25}, -- pillar_4
- {-0.4375, -0.4375, -0.4375, 0.4375, -0.375, 0.4375}, -- ground_1
- {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- ground_2
- }
- }
- })
- minetest.register_node("gold_and_gem:pillar_top_"..mat, {
- tiles = {
- "technic_marble.png",
- "technic_marble.png",
- "goldgem_pillar_front_"..mat.."_top.png",
- "goldgem_pillar_back_"..mat..".png",
- "goldgem_pillar_right_"..mat.."_top.png",
- "goldgem_pillar_left_"..mat.."_top.png"
- },
- description = "Marble Pillar Top "..name,
- drawtype = "nodebox",
- paramtype = "light",
- is_ground_content = true,
- groups = {cracky=3},
- sounds = default.node_sound_stone_defaults(),
- node_box = {
- type = "fixed",
- fixed = {
- {-0.375, -0.5, -0.125, 0.375, 0.5, 0.125}, -- pillar_1
- {-0.125, -0.5, -0.375, 0.125, 0.5, 0.375}, -- pillar_2
- {-0.25, -0.5, -0.3125, 0.25, 0.5, 0.3125}, -- pillar_3
- {-0.3125, -0.5, -0.25, 0.3125, 0.5, 0.25}, -- pillar_4
- {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- top_1
- {-0.4375, 0.375, -0.4375, 0.4375, 0.4375, 0.4375}, -- top_2
- }
- }
- })
- end
|