added birthstones

master
Brett O'Donnell 2012-11-09 00:11:28 +10:30
parent df27bec169
commit bd11839d21
40 changed files with 793 additions and 85 deletions

View File

@ -1,85 +1,86 @@
----------------------------------
Go Play Modpack for Minetest
----------------------------------
Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
Source Code: https://github.com/cornernote/minetest-go_play_modpack
Home Page: https://sites.google.com/site/cornernote/minetest/go-play
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
----------------------------------
Description
----------------------------------
This modpack has many mods installed for a fun and interesting gaming experience.
Although it works with the default minetest_game, it is recommended to use PilzAdam's latest minetest_game, available at: https://github.com/PilzAdam/minetest_game
To view the items and craft recipies, please visit the Game Wiki: http://cornernote.net/minetest/go_play/wiki
----------------------------------
Installation
----------------------------------
Unzip into minetest/mods/
----------------------------------
Mods Used
----------------------------------
Thank you to all the developers who's mods make up this release.
3dforniture - http://minetest.net/forum/viewtopic.php?id=2207
bags - http://minetest.net/forum/viewtopic.php?id=3081
bones - http://minetest.net/forum/viewtopic.php?id=2206
builtin_item - http://minetest.net/forum/viewtopic.php?id=3188
carts - http://minetest.net/forum/viewtopic.php?id=2451
chess - http://minetest.net/forum/viewtopic.php?id=2784
clock_face - http://minetest.net/forum/viewtopic.php?id=807
craft_guide - http://minetest.net/forum/viewtopic.php?id=2334
farming_plus - http://minetest.net/forum/viewtopic.php?id=2787
flint_and_steel - http://minetest.net/forum/viewtopic.php?id=1683
flowers - http://minetest.net/forum/viewtopic.php?id=2624
food - http://minetest.net/forum/viewtopic.php?id=2960
gates - http://minetest.net/forum/viewtopic.php?id=2943
growing_trees - http://minetest.net/forum/viewtopic.php?id=978
habitat - http://minetest.net/forum/viewtopic.php?id=2619
hatches - http://minetest.net/forum/viewtopic.php?id=609
homedecor - http://minetest.net/forum/viewtopic.php?id=2041
home_gui - http://minetest.net/forum/viewtopic.php?id=3101
infinite_chest - http://minetest.net/forum/viewtopic.php?id=3053
infinitytools - http://minetest.net/forum/viewtopic.php?id=2535
inventory_plus - http://minetest.net/forum/viewtopic.php?id=3100
item_drop - http://minetest.net/forum/viewtopic.php?id=2656
junglegrass - http://minetest.net/forum/viewtopic.php?id=2307
jungletree - http://minetest.net/forum/viewtopic.php?id=2887
jumping - http://minetest.net/forum/viewtopic.php?id=2957
mesecons - http://minetest.net/forum/viewtopic.php?id=628
moreores - http://minetest.net/forum/viewtopic.php?id=549
particles - http://minetest.net/forum/viewtopic.php?id=3082
pipeworks - http://minetest.net/forum/viewtopic.php?id=2155
plants - http://minetest.net/forum/viewtopic.php?id=2619
rubiks - http://minetest.net/forum/viewtopic.php?id=3342
scaffolding - http://minetest.net/forum/viewtopic.php?id=3205
secret_passage - http://minetest.net/forum/viewtopic.php?id=667
sim_paint - http://minetest.net/forum/viewtopic.php?id=1279
signs - http://minetest.net/forum/viewtopic.php?id=3289
snow - http://minetest.net/forum/viewtopic.php?id=2290
stairsplus - http://minetest.net/forum/viewtopic.php?id=2092
streets - http://minetest.net/forum/viewtopic.php?id=2984
technic - http://minetest.net/forum/viewtopic.php?id=2538
terrariumblocks - http://minetest.net/forum/viewtopic.php?id=2905
vines - http://minetest.net/forum/viewtopic.php?id=2344
xbar - http://minetest.net/forum/viewtopic.php?id=2215
xfences - http://minetest.net/forum/viewtopic.php?id=2127
xpanes - http://minetest.net/forum/viewtopic.php?id=2117
workbench - http://minetest.net/forum/viewtopic.php?id=3275
worldtime - http://minetest.net/forum/viewtopic.php?id=2205
----------------------------------
Go Play Modpack for Minetest
----------------------------------
Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
Source Code: https://github.com/cornernote/minetest-go_play_modpack
Home Page: https://sites.google.com/site/cornernote/minetest/go-play
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
----------------------------------
Description
----------------------------------
This modpack has many mods installed for a fun and interesting gaming experience.
Although it works with the default minetest_game, it is recommended to use PilzAdam's latest minetest_game, available at: https://github.com/PilzAdam/minetest_game
To view the items and craft recipies, please visit the Game Wiki: http://cornernote.net/minetest/go_play/wiki
----------------------------------
Installation
----------------------------------
Unzip into minetest/mods/
----------------------------------
Mods Used
----------------------------------
Thank you to all the developers who's mods make up this release.
3dforniture - http://minetest.net/forum/viewtopic.php?id=2207
bags - http://minetest.net/forum/viewtopic.php?id=3081
birthstones - http://minetest.net/forum/viewtopic.php?id=3663
bones - http://minetest.net/forum/viewtopic.php?id=2206
builtin_item - http://minetest.net/forum/viewtopic.php?id=3188
carts - http://minetest.net/forum/viewtopic.php?id=2451
chess - http://minetest.net/forum/viewtopic.php?id=2784
clock_face - http://minetest.net/forum/viewtopic.php?id=807
craft_guide - http://minetest.net/forum/viewtopic.php?id=2334
farming_plus - http://minetest.net/forum/viewtopic.php?id=2787
flint_and_steel - http://minetest.net/forum/viewtopic.php?id=1683
flowers - http://minetest.net/forum/viewtopic.php?id=2624
food - http://minetest.net/forum/viewtopic.php?id=2960
gates - http://minetest.net/forum/viewtopic.php?id=2943
growing_trees - http://minetest.net/forum/viewtopic.php?id=978
habitat - http://minetest.net/forum/viewtopic.php?id=2619
hatches - http://minetest.net/forum/viewtopic.php?id=609
homedecor - http://minetest.net/forum/viewtopic.php?id=2041
home_gui - http://minetest.net/forum/viewtopic.php?id=3101
infinite_chest - http://minetest.net/forum/viewtopic.php?id=3053
infinitytools - http://minetest.net/forum/viewtopic.php?id=2535
inventory_plus - http://minetest.net/forum/viewtopic.php?id=3100
item_drop - http://minetest.net/forum/viewtopic.php?id=2656
junglegrass - http://minetest.net/forum/viewtopic.php?id=2307
jungletree - http://minetest.net/forum/viewtopic.php?id=2887
jumping - http://minetest.net/forum/viewtopic.php?id=2957
mesecons - http://minetest.net/forum/viewtopic.php?id=628
moreores - http://minetest.net/forum/viewtopic.php?id=549
particles - http://minetest.net/forum/viewtopic.php?id=3082
pipeworks - http://minetest.net/forum/viewtopic.php?id=2155
plants - http://minetest.net/forum/viewtopic.php?id=2619
rubiks - http://minetest.net/forum/viewtopic.php?id=3342
scaffolding - http://minetest.net/forum/viewtopic.php?id=3205
secret_passage - http://minetest.net/forum/viewtopic.php?id=667
sim_paint - http://minetest.net/forum/viewtopic.php?id=1279
signs - http://minetest.net/forum/viewtopic.php?id=3289
snow - http://minetest.net/forum/viewtopic.php?id=2290
stairsplus - http://minetest.net/forum/viewtopic.php?id=2092
streets - http://minetest.net/forum/viewtopic.php?id=2984
technic - http://minetest.net/forum/viewtopic.php?id=2538
terrariumblocks - http://minetest.net/forum/viewtopic.php?id=2905
vines - http://minetest.net/forum/viewtopic.php?id=2344
xbar - http://minetest.net/forum/viewtopic.php?id=2215
xfences - http://minetest.net/forum/viewtopic.php?id=2127
xpanes - http://minetest.net/forum/viewtopic.php?id=2117
workbench - http://minetest.net/forum/viewtopic.php?id=3275
worldtime - http://minetest.net/forum/viewtopic.php?id=2205

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

1
birthstones/depends.txt Normal file
View File

@ -0,0 +1 @@
default

353
birthstones/init.lua Normal file
View File

@ -0,0 +1,353 @@
minetest.register_node( "birthstones:diamondore", {
description = "Diamond Ore",
tile_images = { "default_stone.png^Diamond_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:diamond" 1',
})
minetest.register_node( "birthstones:alexandriteore", {
description = "Alexandrite Ore",
tile_images = { "default_stone.png^Alexandrite_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:alexandrite" 1',
})
minetest.register_node( "birthstones:amethystore", {
description = "Amethyst Ore",
tile_images = { "default_stone.png^Amethyst_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:amethyst" 1',
})
minetest.register_node( "birthstones:aquamarineore", {
description = "Aquamarine Ore",
tile_images = { "default_stone.png^Aquamarine_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:aquamarine" 1',
})
minetest.register_node( "birthstones:emeraldore", {
description = "Emerald Ore",
tile_images = { "default_stone.png^Emerald_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:emerald" 1',
})
minetest.register_node( "birthstones:garnetore", {
description = "Garnet Ore",
tile_images = { "default_stone.png^Garnet_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:garnet" 1',
})
minetest.register_node( "birthstones:opalore", {
description = "Opal Ore",
tile_images = { "default_stone.png^Opal_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:opal" 1',
})
minetest.register_node( "birthstones:peridotore", {
description = "Peridot Ore",
tile_images = { "default_stone.png^Peridot_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:peridot" 1',
})
minetest.register_node( "birthstones:rubyore", {
description = "Ruby Ore",
tile_images = { "default_stone.png^Ruby_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:ruby" 1',
})
minetest.register_node( "birthstones:sapphireore", {
description = "Sapphire Ore",
tile_images = { "default_stone.png^Sapphire_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:sapphire" 1',
})
minetest.register_node( "birthstones:topazore", {
description = "Topaz Ore",
tile_images = { "default_stone.png^Topaz_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:topazore" 1',
})
minetest.register_node( "birthstones:topazore", {
description = "Topaz Ore",
tile_images = { "default_stone.png^Topaz_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:topaz" 1',
})
minetest.register_node( "birthstones:zirconore", {
description = "Zircon Ore",
tile_images = { "default_stone.png^Zircon_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:zircon" 1',
})
minetest.register_craftitem( "birthstones:alexandrite", {
description = "Alexandrite (January)",
inventory_image = "Alexandrite.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:amethyst", {
description = "Amethyst (February)",
inventory_image = "Amethyst.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:aquamarine", {
description = "Aquamarine (March)",
inventory_image = "Aquamarine.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:diamond", {
description = "Diamond (April)",
inventory_image = "Diamond.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:emerald", {
description = "Emerald (May)",
inventory_image = "Emerald.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:garnet", {
description = "Garnet (June)",
inventory_image = "Garnet.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:opal", {
description = "Opal (July)",
inventory_image = "Opal.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:peridot", {
description = "Peridot (August)",
inventory_image = "Peridot.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:ruby", {
description = "Ruby (September)",
inventory_image = "Ruby.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:sapphire", {
description = "Sapphire (October)",
inventory_image = "Sapphire.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:topaz", {
description = "Topaz (November)",
inventory_image = "Topaz.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:zircon", {
description = "Zircon (December)",
inventory_image = "Zircon.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_node( "birthstones:alexandriteblock", {
description = "Alexandrite Block",
tile_images = { "Alexandrite_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:amethystblock", {
description = "Amethyst Block",
tile_images = { "Amethyst_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:aquamarineblock", {
description = "Aquamarine Block",
tile_images = { "Aquamarine_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:diamondblock", {
description = "Diamond Block",
tile_images = { "Diamond_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:emeraldblock", {
description = "Emerald Block",
tile_images = { "Emerald_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:garnetblock", {
description = "Garnet Block",
tile_images = { "Garnet_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:opalblock", {
description = "Opal Block",
tile_images = { "Opal_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:peridotblock", {
description = "Peridot Block",
tile_images = { "Peridot_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:rubyblock", {
description = "Ruby Block",
tile_images = { "Ruby_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:sapphireblock", {
description = "Sapphire Block",
tile_images = { "Sapphire_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:topazblock", {
description = "Topaz Block",
tile_images = { "Topaz_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:zirconblock", {
description = "Zircon Block",
tile_images = { "Zircon_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
local function registerblockrecipe(name, blockname)
minetest.register_craft({
output = blockname,
recipe = {{name, name, name},
{name, name, name},
{name, name, name}
}
})
end
registerblockrecipe('birthstones:alexandrite', 'birthstones:alexandriteblock')
registerblockrecipe('birthstones:amethyst', 'birthstones:amethystblock')
registerblockrecipe('birthstones:aquamarine', 'birthstones:aquamarineblock')
registerblockrecipe('birthstones:diamond', 'birthstones:diamondblock')
registerblockrecipe('birthstones:emerald', 'birthstones:emeraldblock')
registerblockrecipe('birthstones:garnet', 'birthstones:garnetblock')
registerblockrecipe('birthstones:opal', 'birthstones:opalblock')
registerblockrecipe('birthstones:peridot', 'birthstones:peridotblock')
registerblockrecipe('birthstones:ruby', 'birthstones:rubyblock')
registerblockrecipe('birthstones:sapphire', 'birthstones:sapphireblock')
registerblockrecipe('birthstones:topaz', 'birthstones:topazblock')
registerblockrecipe('birthstones:zircon', 'birthstones:zirconblock')
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed)
local num_chunks = math.floor(chunks_per_volume * volume)
local chunk_size = 3
if ore_per_chunk <= 4 then
chunk_size = 2
end
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
--print("generate_ore num_chunks: "..dump(num_chunks))
for i=1,num_chunks do
local y0 = pr:next(y_min, y_max-chunk_size+1)
if y0 >= height_min and y0 <= height_max then
local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
local p0 = {x=x0, y=y0, z=z0}
for x1=0,chunk_size-1 do
for y1=0,chunk_size-1 do
for z1=0,chunk_size-1 do
if pr:next(1,inverse_chance) == 1 then
local x2 = x0+x1
local y2 = y0+y1
local z2 = z0+z1
local p2 = {x=x2, y=y2, z=z2}
if minetest.env:get_node(p2).name == wherein then
minetest.env:set_node(p2, {name=name})
end
end
end
end
end
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:alexandriteore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -40)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:amethystore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -50)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:aquamarineore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -10)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:diamondore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -300)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:emeraldore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -100)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:garnetore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -70)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:peridotore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -60)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:rubyore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -120)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:sapphireore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -120)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:topazore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -80)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:zirconore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -70)
end)

353
birthstones/init.txt Normal file
View File

@ -0,0 +1,353 @@
minetest.register_node( "birthstones:diamondore", {
description = "Diamond Ore",
tile_images = { "default_stone.png^Diamond_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:diamond" 1',
})
minetest.register_node( "birthstones:alexandriteore", {
description = "Alexandrite Ore",
tile_images = { "default_stone.png^Alexandrite_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:alexandrite" 1',
})
minetest.register_node( "birthstones:amethystore", {
description = "Amethyst Ore",
tile_images = { "default_stone.png^Amethyst_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:amethyst" 1',
})
minetest.register_node( "birthstones:aquamarineore", {
description = "Aquamarine Ore",
tile_images = { "default_stone.png^Aquamarine_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:aquamarine" 1',
})
minetest.register_node( "birthstones:emeraldore", {
description = "Emerald Ore",
tile_images = { "default_stone.png^Emerald_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:emerald" 1',
})
minetest.register_node( "birthstones:garnetore", {
description = "Garnet Ore",
tile_images = { "default_stone.png^Garnet_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:garnet" 1',
})
minetest.register_node( "birthstones:opalore", {
description = "Opal Ore",
tile_images = { "default_stone.png^Opal_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:opal" 1',
})
minetest.register_node( "birthstones:peridotore", {
description = "Peridot Ore",
tile_images = { "default_stone.png^Peridot_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:peridot" 1',
})
minetest.register_node( "birthstones:rubyore", {
description = "Ruby Ore",
tile_images = { "default_stone.png^Ruby_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:ruby" 1',
})
minetest.register_node( "birthstones:sapphireore", {
description = "Sapphire Ore",
tile_images = { "default_stone.png^Sapphire_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:sapphire" 1',
})
minetest.register_node( "birthstones:topazore", {
description = "Topaz Ore",
tile_images = { "default_stone.png^Topaz_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:topazore" 1',
})
minetest.register_node( "birthstones:topazore", {
description = "Topaz Ore",
tile_images = { "default_stone.png^Topaz_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:topaz" 1',
})
minetest.register_node( "birthstones:zirconore", {
description = "Zircon Ore",
tile_images = { "default_stone.png^Zircon_overlay.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
drop = 'craft "birthstones:zircon" 1',
})
minetest.register_craftitem( "birthstones:alexandrite", {
description = "Alexandrite (January)",
inventory_image = "Alexandrite.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:amethyst", {
description = "Amethyst (February)",
inventory_image = "Amethyst.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:aquamarine", {
description = "Aquamarine (March)",
inventory_image = "Aquamarine.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:diamond", {
description = "Diamond (April)",
inventory_image = "Diamond.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:emerald", {
description = "Emerald (May)",
inventory_image = "Emerald.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:garnet", {
description = "Garnet (June)",
inventory_image = "Garnet.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:opal", {
description = "Opal (July)",
inventory_image = "Opal.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:peridot", {
description = "Peridot (August)",
inventory_image = "Peridot.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:ruby", {
description = "Ruby (September)",
inventory_image = "Ruby.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:sapphire", {
description = "Sapphire (October)",
inventory_image = "Sapphire.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:topaz", {
description = "Topaz (November)",
inventory_image = "Topaz.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:zircon", {
description = "Zircon (December)",
inventory_image = "Zircon.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_node( "birthstones:alexandriteblock", {
description = "Alexandrite Block",
tile_images = { "Alexandrite_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:amethystblock", {
description = "Amethyst Block",
tile_images = { "Amethyst_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:aquamarineblock", {
description = "Aquamarine Block",
tile_images = { "Aquamarine_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:diamondblock", {
description = "Diamond Block",
tile_images = { "Diamond_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:emeraldblock", {
description = "Emerald Block",
tile_images = { "Emerald_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:garnetblock", {
description = "Garnet Block",
tile_images = { "Garnet_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:opalblock", {
description = "Opal Block",
tile_images = { "Opal_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:peridotblock", {
description = "Peridot Block",
tile_images = { "Peridot_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:rubyblock", {
description = "Ruby Block",
tile_images = { "Ruby_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:sapphireblock", {
description = "Sapphire Block",
tile_images = { "Sapphire_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:topazblock", {
description = "Topaz Block",
tile_images = { "Topaz_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:zirconblock", {
description = "Zircon Block",
tile_images = { "Zircon_block.png" },
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
local function registerblockrecipe(name, blockname)
minetest.register_craft({
output = blockname,
recipe = {{name, name, name},
{name, name, name},
{name, name, name}
}
})
end
registerblockrecipe('birthstones:alexandrite', 'birthstones:alexandriteblock')
registerblockrecipe('birthstones:amethyst', 'birthstones:amethystblock')
registerblockrecipe('birthstones:aquamarine', 'birthstones:aquamarineblock')
registerblockrecipe('birthstones:diamond', 'birthstones:diamondblock')
registerblockrecipe('birthstones:emerald', 'birthstones:emeraldblock')
registerblockrecipe('birthstones:garnet', 'birthstones:garnetblock')
registerblockrecipe('birthstones:opal', 'birthstones:opalblock')
registerblockrecipe('birthstones:peridot', 'birthstones:peridotblock')
registerblockrecipe('birthstones:ruby', 'birthstones:rubyblock')
registerblockrecipe('birthstones:sapphire', 'birthstones:sapphireblock')
registerblockrecipe('birthstones:topaz', 'birthstones:topazblock')
registerblockrecipe('birthstones:zircon', 'birthstones:zirconblock')
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max)
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed)
local num_chunks = math.floor(chunks_per_volume * volume)
local chunk_size = 3
if ore_per_chunk <= 4 then
chunk_size = 2
end
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
--print("generate_ore num_chunks: "..dump(num_chunks))
for i=1,num_chunks do
local y0 = pr:next(y_min, y_max-chunk_size+1)
if y0 >= height_min and y0 <= height_max then
local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
local p0 = {x=x0, y=y0, z=z0}
for x1=0,chunk_size-1 do
for y1=0,chunk_size-1 do
for z1=0,chunk_size-1 do
if pr:next(1,inverse_chance) == 1 then
local x2 = x0+x1
local y2 = y0+y1
local z2 = z0+z1
local p2 = {x=x2, y=y2, z=z2}
if minetest.env:get_node(p2).name == wherein then
minetest.env:set_node(p2, {name=name})
end
end
end
end
end
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:alexandriteore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -40)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:amethystore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -50)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:aquamarineore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -10)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:diamondore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -300)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:emeraldore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -100)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:garnetore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -70)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:peridotore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -60)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:rubyore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -120)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:sapphireore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -120)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:topazore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -80)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:zirconore", "default:stone", minp, maxp, seed+21, 1/10/10/10, 10, -31000, -70)
end)