123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660 |
- local vert1 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
- }
- }
- local vert2 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
- }
- }
- local vert3 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
- }
- }
- local vert4 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, 0.5, 0.5},
- }
- }
- local hori1 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
- {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
- }
- }
- local hori2 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
- {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
- }
- }
- local hori3 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
- {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
- }
- }
- local hori4 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
- {-0.5, 0.1875, -0.5, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, 0.5, -0.1875, 0.5},
- }
- }
- local cross1 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
- {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
- {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
- }
- }
- local cross2 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
- {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
- {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
- }
- }
- local cross3 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
- {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
- {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
- }
- }
- local cross4 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
- {0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
- {-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
- {-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
- {0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
- }
- }
- local chis1 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
- {-0.4375, -0.4375, -0.5, 0.4375, 0.4375, 0.5},
- }
- }
- local chis2 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
- {-0.375, -0.375, -0.5, 0.375, 0.375, 0.5},
- {-0.4375, -0.4375, -0.4375, 0.4375, 0.4375, 0.5},
- }
- }
- local chis3 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
- {-0.375, -0.375, -0.4375, 0.375, 0.375, 0.5},
- {-0.4375, -0.4375, -0.375, 0.4375, 0.4375, 0.5},
- {-0.3125, -0.3125, -0.5, 0.3125, 0.3125, 0.5},
- }
- }
- local chis4 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
- {-0.375, -0.375, -0.375, 0.375, 0.375, 0.5},
- {-0.4375, -0.4375, -0.3125, 0.4375, 0.4375, 0.5},
- {-0.3125, -0.3125, -0.4375, 0.3125, 0.3125, 0.5},
- {-0.25, -0.25, -0.5, 0.25, 0.25, 0.5},
- }
- }
- local squar1 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.4375},
- {0.3125, -0.5, -0.5, 0.5, 0.5, -0.4375},
- {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.4375},
- {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.4375},
- }
- }
- local squar2 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.375, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.375},
- {0.3125, -0.5, -0.5, 0.5, 0.5, -0.375},
- {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.375},
- {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.375},
- }
- }
- local squar3 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.3125, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
- {0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
- {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.3125},
- {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.3125},
- }
- }
- local squar4 = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
- {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.25},
- {0.3125, -0.5, -0.5, 0.5, 0.5, -0.25},
- {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.25},
- {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.25},
- }
- }
- local default_material = {
- {"default:cobble", "default_cobble", "Cobble", {cracky = 3, not_in_creative_inventory=1}},
- {"default:sandstone","default_sandstone", "Sandstone", {crumbly=2, not_in_creative_inventory=1}},
- {"default:clay","default_clay", "Clay", {crumbly=3, not_in_creative_inventory=1}},
- {"default:coalblock","default_coal_block", "Coal Block", {cracky = 3, not_in_creative_inventory=1}},
- {"default:stone","default_stone", "Stone", {cracky = 3, not_in_creative_inventory=1}},
- {"default:desert_stone","default_desert_stone", "Desert Stone", {cracky = 3, not_in_creative_inventory=1}},
- {"default:wood","default_wood", "Wood", {choppy=2, not_in_creative_inventory=1}},
- {"default:acacia_wood","default_acacia_wood", "Acacia Wood", {choppy=2, not_in_creative_inventory=1}},
- {"default:aspen_wood","default_aspen_wood", "Aspen Wood", {choppy=2, not_in_creative_inventory=1}},
- {"default:pine_wood","default_pine_wood", "Pine Wood", {choppy=2, not_in_creative_inventory=1}},
- {"default:desert_cobble","default_desert_cobble", "Desert Cobble", {cracky = 3, not_in_creative_inventory=1}},
- {"default:junglewood","default_junglewood", "Jungle Wood", {choppy=2, not_in_creative_inventory=1}},
- {"default:sandstonebrick","default_sandstone_brick", "Sandstone Brick", {cracky = 2, not_in_creative_inventory=1}},
- {"default:stonebrick","default_stone_brick", "Stone Brick", {cracky = 2, not_in_creative_inventory=1}},
- {"default:desert_stonebrick","default_desert_stone_brick", "Desert Stone Brick", {cracky = 2, not_in_creative_inventory=1}},
- }
- for i in ipairs (default_material) do
- local item = default_material [i][1]
- local mat = default_material [i][2]
- local desc = default_material [i][3]
- local gro = default_material [i][4]
- minetest.register_node("mychisel:vertical_"..mat.."1", {
- description = "Vertical "..desc.."1",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_vtint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = vert1,
- selection_box = vert1,
- on_place = minetest.rotate_node,
- })
- minetest.register_node("mychisel:vertical_"..mat.."2", {
- description = "Vertical "..desc.."2",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_vtint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = vert2,
- selection_box = vert2
- })
- minetest.register_node("mychisel:vertical_"..mat.."3", {
- description = "Vertical "..desc.."3",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_vtint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = vert3,
- selection_box = vert3
- })
- minetest.register_node("mychisel:vertical_"..mat.."4", {
- description = "Vertical "..desc.."4",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_vtint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = vert4,
- selection_box = vert4
- })
- minetest.register_node("mychisel:chiseled_"..mat.."1", {
- description = "Chiseled"..desc.."1",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint1.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = chis1,
- selection_box = chis1,
- })
- minetest.register_node("mychisel:chiseled_"..mat.."2", {
- description = "Chiseled"..desc.."2",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint2.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = chis2,
- selection_box = chis2
- })
- minetest.register_node("mychisel:chiseled_"..mat.."3", {
- description = "Chiseled"..desc.."3",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint3.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = chis3,
- selection_box = chis3
- })
- minetest.register_node("mychisel:chiseled_"..mat.."4", {
- description = "Chiseled"..desc.."4",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint4.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = chis4,
- selection_box = chis4
- })
- minetest.register_node("mychisel:horizontal_"..mat.."1", {
- description = "Horizontal "..desc.."1",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_htint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = hori1,
- selection_box = hori1
- })
- minetest.register_node("mychisel:horizontal_"..mat.."2", {
- description = "Horizontal"..desc.."2",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_htint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = hori2,
- selection_box = hori2
- })
- minetest.register_node("mychisel:horizontal_"..mat.."3", {
- description = "Horizontal"..desc.."3",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_htint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = hori3,
- selection_box = hori3
- })
- minetest.register_node("mychisel:horizontal_"..mat.."4", {
- description = "Horizontal"..desc.."4",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_htint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = hori4,
- selection_box = hori4
- })
- minetest.register_node("mychisel:cross_"..mat.."1", {
- description = "cross "..desc.."1",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = cross1,
- selection_box = cross1
- })
- minetest.register_node("mychisel:cross_"..mat.."2", {
- description = "cross"..desc.."2",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = cross2,
- selection_box = cross2
- })
- minetest.register_node("mychisel:cross_"..mat.."3", {
- description = "cross"..desc.."3",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = cross3,
- selection_box = cross3
- })
- minetest.register_node("mychisel:cross_"..mat.."4", {
- description = "cross"..desc.."4",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_ctint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = cross4,
- selection_box = cross4
- })
- minetest.register_node("mychisel:square_"..mat.."1", {
- description = "cross "..desc.."1",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_stint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = squar1,
- selection_box = squar1
- })
- minetest.register_node("mychisel:square_"..mat.."2", {
- description = "cross"..desc.."2",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_stint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = squar2,
- selection_box = squar2
- })
- minetest.register_node("mychisel:square_"..mat.."3", {
- description = "cross"..desc.."3",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_stint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = squar3,
- selection_box = squar3
- })
- minetest.register_node("mychisel:square_"..mat.."4", {
- description = "cross"..desc.."4",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png", mat..".png", mat..".png",
- mat..".png^mychisel_stint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = squar4,
- selection_box = squar4
- })
- minetest.register_node("mychisel:square_"..mat.."4", {
- description = "cross"..desc.."4",
- drawtype = "nodebox",
- tiles = {
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png",
- mat..".png^mychisel_stint.png",
- },
- paramtype = "light",
- paramtype2 = "facedir",
- drop = item,
- groups = gro,
- node_box = squar4,
- selection_box = squar4
- })
- minetest.register_node("mychisel:chisel_deco", {
- drawtype = "nodebox",
- paramtype = "light",
- paramtype2 = "facedir",
- tiles = {
- "default_steel_block.png",
- "default_wood.png",
- "mychisel_chisel.png",
- "mychisel_chisel.png",
- "mychisel_chisel.png",
- "mychisel_chisel.png"
- },
- groups = {
- snappy=3,
- flammable=2,
- not_in_creative_inventory=1
- },
- node_box = {
- type = "fixed",
- fixed = {
- {-0.125, -0.5, -0.125, 0.125, 0.25, 0.125}, -- NodeBox1
- {-0.1875, 0.25, -0.1875, 0.1875, 0.5, 0.1875}, -- NodeBox2
- }
- },
- sounds = default.node_sound_wood_defaults(),
- on_dig = function(pos, node, digger)
- if digger:is_player() and digger:get_inventory() then
- local meta = minetest.env:get_meta(pos)
- local wear_out = meta:get_int("wear")
- digger:get_inventory():add_item("main", {name="mychisel:chisel", count=1, wear=wear_out, metadata=""})
- end
- minetest.remove_node(pos)
- end,
- })
- end
|