RealBadAngel
2012-11-07 42f01a7f93c644a1d7b7286855beae70acbeab35
commit | author | age
ad3a43 1 minetest.register_node( "technic:marble", {
MK 2     description = "Marble",
3     tiles = { "technic_marble.png" },
4     is_ground_content = true,
5     groups = {cracky=3},
6     sounds = default.node_sound_stone_defaults(),
7 }) 
8
2e96b9 9 minetest.register_node( "technic:marble_bricks", {
MK 10     description = "Marble Bricks",
11     tiles = { "technic_marble_bricks.png" },
12     is_ground_content = true,
13     groups = {cracky=3},
14     sounds = default.node_sound_stone_defaults(),
15 }) 
16
17 minetest.register_craft({
18     output = 'technic:marble_bricks 4',
19     recipe = {
20         {'technic:marble','technic:marble'},
21         {'technic:marble','technic:marble'}
22     }
23 })
24
25 minetest.register_node( "technic:granite", {
33eba5 26     description = "Granite",
2e96b9 27     tiles = { "technic_granite.png" },
MK 28     is_ground_content = true,
29     groups = {cracky=3},
30     sounds = default.node_sound_stone_defaults(),
31 }) 
ad3a43 32
33eba5 33 stairsplus.register_stair_and_slab_and_panel_and_micro("marble", "technic:marble",
MK 34         {cracky=3},
35         {"technic_marble.png"},
36         "Marble Stairs",
37         "Marble Slab",
38         "Marble Panel",
39         "Marble Microblock",
40         "marble")
41 stairsplus.register_stair_and_slab_and_panel_and_micro("marble_bricks", "technic:marble_bricks",
42         {cracky=3},
43         {"technic_marble_bricks.png"},
44         "Marble Bricks Stairs",
45         "Marble Bricks Slab",
46         "Marble Bricks Panel",
47         "Marble Bricks Microblock",
48         "marble_bricks")
49 stairsplus.register_stair_and_slab_and_panel_and_micro("granite", "technic:granite",
50         {cracky=3},
51         {"technic_granite.png"},
52         "Granite Stairs",
53         "Granite Slab",
54         "Granite Panel",
55         "Granite Microblock",
56         "granite")
57
167434 58 minetest.register_node( "technic:mineral_diamond", {
MK 59     description = "Diamond Ore",
77007b 60     tiles = { "default_stone.png^technic_mineral_diamond.png" },
167434 61     is_ground_content = true,
MK 62     groups = {cracky=3},
63     sounds = default.node_sound_stone_defaults(),
64     drop = 'craft "technic:diamond" 1',
65 }) 
66
67 minetest.register_craftitem( "technic:diamond", {
68     description = "Diamond",
69     inventory_image = "technic_diamond.png",
70     on_place_on_ground = minetest.craftitem_place_item,
71 })
77007b 72
MK 73 minetest.register_node( "technic:mineral_uranium", {
74     description = "Uranium Ore",
75     tiles = { "default_stone.png^technic_mineral_uranium.png" },
76     is_ground_content = true,
77     groups = {cracky=3},
78     sounds = default.node_sound_stone_defaults(),
79     drop = 'craft "technic:uranium" 1',
80 }) 
81
82 minetest.register_craftitem( "technic:uranium", {
83     description = "Uranium",
84     inventory_image = "technic_uranium.png",
85     on_place_on_ground = minetest.craftitem_place_item,
86 })
87
88 minetest.register_node( "technic:mineral_chromium", {
89     description = "Chromium Ore",
90     tiles = { "default_stone.png^technic_mineral_chromium.png" },
91     is_ground_content = true,
92     groups = {cracky=3},
93     sounds = default.node_sound_stone_defaults(),
94     drop = 'craft "technic:chromium_lump" 1',
95 }) 
96
97 minetest.register_craftitem( "technic:chromium_lump", {
98     description = "Chromium Lump",
99     inventory_image = "technic_chromium_lump.png",
100     on_place_on_ground = minetest.craftitem_place_item,
101 })
102
103 minetest.register_craftitem( "technic:chromium_ingot", {
104     description = "Chromium Ingot",
105     inventory_image = "technic_chromium_ingot.png",
106     on_place_on_ground = minetest.craftitem_place_item,
107 })
108
109 minetest.register_craft({
110                 type = 'cooking',
111                 output = "technic:chromium_ingot",
112                 recipe = "technic:chromium_lump"
113             })
804887 114
MK 115
116 minetest.register_node( "technic:mineral_zinc", {
117     description = "Zinc Ore",
118     tile_images = { "default_stone.png^technic_mineral_zinc.png" },
119     is_ground_content = true,
120     groups = {cracky=3},
121     sounds = default.node_sound_stone_defaults(),
122     drop = 'craft "technic:zinc_lump" 1',
123 })
124
125 minetest.register_craftitem( "technic:zinc_lump", {
126     description = "Zinc Lump",
127     inventory_image = "technic_zinc_lump.png",
128 })
129
130 minetest.register_craftitem( "technic:zinc_ingot", {
131     description = "Zinc Ingot",
132     inventory_image = "technic_zinc_ingot.png",
133 })
134
eabde4 135 minetest.register_craftitem( "technic:stainless_steel_ingot", {
MK 136     description = "Stainless Steel Ingot",
137     inventory_image = "technic_stainless_steel_ingot.png",
138 })
139
140 minetest.register_craftitem( "technic:brass_ingot", {
141     description = "Brass Ingot",
142     inventory_image = "technic_brass_ingot.png",
143 })
144
804887 145 minetest.register_craft({
MK 146                 type = 'cooking',
147                 output = "technic:zinc_ingot",
148                 recipe = "technic:zinc_lump"
149             })
150
167434 151
MK 152 local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
153     if maxp.y < height_min or minp.y > height_max then
154         return
155     end
156     local y_min = math.max(minp.y, height_min)
157     local y_max = math.min(maxp.y, height_max)
158     local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
159     local pr = PseudoRandom(seed)
160     local num_chunks = math.floor(chunks_per_volume * volume)
161     local chunk_size = 3
162     if ore_per_chunk <= 4 then
163         chunk_size = 2
164     end
165     local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
166     --print("generate_ore num_chunks: "..dump(num_chunks))
167     for i=1,num_chunks do
168     if (y_max-chunk_size+1 <= y_min) then return end
169         local y0 = pr:next(y_min, y_max-chunk_size+1)
170         if y0 >= height_min and y0 <= height_max then
171             local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
172             local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
173             local p0 = {x=x0, y=y0, z=z0}
174             for x1=0,chunk_size-1 do
175             for y1=0,chunk_size-1 do
176             for z1=0,chunk_size-1 do
177                 if pr:next(1,inverse_chance) == 1 then
178                     local x2 = x0+x1
179                     local y2 = y0+y1
180                     local z2 = z0+z1
181                     local p2 = {x=x2, y=y2, z=z2}
182                     if minetest.env:get_node(p2).name == wherein then
183                         minetest.env:set_node(p2, {name=name})
184                     end
185                 end
186             end
187             end
188             end
189         end
190     end
191     --print("generate_ore done")
192 end
193
194 minetest.register_on_generated(function(minp, maxp, seed)
42f01a 195 generate_ore("technic:mineral_diamond", "default:stone", minp, maxp, seed+21,   1/11/11/11,    4, -31000,  -300)
01b21d 196 generate_ore("technic:mineral_uranium", "default:stone", minp, maxp, seed+22,   1/10/10/10,    3, -300,  -80)
804887 197 generate_ore("technic:mineral_chromium", "default:stone", minp, maxp, seed+23,   1/10/10/10,    2, -31000,  -100)
01b21d 198 generate_ore("technic:mineral_zinc", "default:stone", minp, maxp, seed+24,   1/9/9/9,    4, -31000,  2)
a9325f 199 generate_ore("technic:marble", "default:stone", minp, maxp, seed+25,    1/128, 20, -100, -32)
2e96b9 200 generate_ore("technic:granite", "default:stone", minp, maxp, seed+25,    1/128, 15, -190, -90)
167434 201 end)