initial changes in expertmm fork

see README
master
Jacob Gustafson 2017-02-12 00:02:53 -05:00
parent edcddc0dbe
commit 535220164f
100 changed files with 782 additions and 398 deletions

BIN
Hardness Calculator.xlsx Normal file

Binary file not shown.

44
LICENSE.txt Normal file
View File

@ -0,0 +1,44 @@
License of source code (unless otherwise specified--see README.txt)
-------------------------------------------------------------------
Copyright 2017 expertmm
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Licenses of media (textures) unless otherwise specified (see README file):
--------------------------------------------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2015-2016 expertmm
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

114
README.txt Normal file
View File

@ -0,0 +1,114 @@
# Minetest Game mod: birthstones
(Based on birthstones Minetest mod by Doc22)
(See "Authors..." sections below for credits)
## Primary differences from original
### Main reasons for fork:
* add more tools
* make changes to code to make use of modern Minetest (such as ore drop string)
### Notable issues found in original (see items marked with '!' in "Changes" section for others):
(hopefully these changes get corrected there)
* birthstones were wrong month (see "birthstones list.csv" in etc folder for corrections, though month names are removed in fork)
* now stone_with_opal is generated now (was impossible to get by mining before, apparently)
* crafting block back to 9 gemstones is now possible
* found some code bugs (see exclamation points under "Changes" below)
### Other major differences from original
Some major changes were done to make the mod easier to maintain:
* changed to minetest_game's naming scheme for filenames and node/tool names (aliases added for backward compatibility)
* componentized into separate lua files for each category of operations
### Things that will be kept the same:
* birthstones:diamond will still be present for now (as opposed to becoming an alias for default:diamond), since the birthstones diamond texture looks cool. The display names for all of the items will say "White Diamond".
## Changes in expertmm fork:
'!' is for bugs in 2012 version that are fixed (as opposed to features that were changed/added) in this fork
* (2017-02-11) Add crafting recipe to convert block back into 9 gems
* (2017-02-11) Add Swords & Shovels
* (2017-02-11) Componentize into separate lua files for each category of operations
* !(2017-02-11) Make opal possible to get: added missing register_on_generated for changing some stone to opal (see oregen.lua)
* !(2017-02-11) Change drop for stone_with_topaz from stone_with_topaz to topaz (apparently this didn't cause an issue since craft method had been used)
* !(2017-02-11) Change drop of ores (to match modern style from default in minetest_game from minetest 0.4.15-git 2017-01), where * below is name, from:
drop = 'craft "birthstones:*" 1',
to
drop = "birthstones:*",
* !(2017-02-11) Block needs better pick to be mined: Changed groups from:
groups = {cracky = 3}
to
groups = {cracky = 1, level = 3}
* !(2017-02-11) Ore needs better pick to be mined: changed groups.cracky of all from 3 to 1
* (2017-02-11) Changed "* Ore" to "Stone with *" (because why copy other people when you can make sense instead)
* !(2017-02-11) Preliminary step in fixing one-chop axes: changed register_tool time2 and time3 from:
[1]=time1-2.0, [2]=2.0-time2, [3]=2.0-time3}
to
times={[1]=time1/2.0, [2]=time2/2.0, [3]=time3/2.0}
* !(2017-02-10) Removed month from display names to avoid breaking immersion (draws too much attention to the items having a "label")
if re-added, months would have to be corrected anyway as follows (in the original mod, alphabetical order instead of actual birthstone month determined month):
see etc/birthstones list.csv
* !(2017-02-10) Fixed issue where topaz ore was registered twice (didn't seem to cause problems)
* !(2017-02-10) Capitalized stone name when used within tool display name
* (2017-02-10) Naming changed to match minetest texture&variable naming scheme (see changes below, where ^* is capitalized mineral name and * is uncapitalized)
(aliases added only for backward compatibility--see aliases.lua--doing aliases can be commented in init.lua)
Files:
^* TO birthstones_* (ITEM)
^*_overlay TO birthstones_mineral_* (ORE OVERLAY)
^*_block TO birthstones_*_block
*_axe to birthstones_tool_*axe
*_pick to birthstones_tool_*pick
^*_block to birthstones_*_block
Variables:
birthstones:*ore TO birthstones:stone_with_*
"birthstones:".. name .. "_pick" TO "birthstones:pick_"..name
"birthstones:".. name .. "_axe" TO "birthstones:axe_"..name
## Known Issues
* No shields & armor from 3d_armor (will be provided as separate mod)
* Make variables based on real hardness values (but allow all birthstones to break the same types of blocks, for playability):
#of uses, dig times, and fleshy damage group value now all based on real-life hardness values
(see xlsx spreadsheet for details and sources and extrapolation formulas)
Formulas were determined using Excel:
* Diamond theoretical Brinell explanation: Excel says the curve on 18carat.co.uk, if a power curve, is Brinell = 2.9592*(ans^2.2856) where ans is Moh value
* Other extrapolated Brinell values (rounded to nearest whole number) explanation: Excel says power function for predicting from density is Brinell = 9.0954*(ans^2.9757) where ans is metric density value
* Extrapolated Moh values explanation: Excel says power curve from 18carat.co.uk materials is: Moh = 0.6514*(ans^0.4269) where ans is Brinell value
(to use Speedcrunch to get values not listed, enter the number without any equation, then paste the formulas above exactly to use that "answer" as a variable--see spreadsheet's "Hardness - Extrapolated" sheet for spreadsheet version of formulas)
Minerals of note not in birthstones (for reference only) with density values from website above:
MORE but with hardness values available from 18carat.co.uk link above:
Name,Density,Moh,Brinell
Apatite,3.16-3.23,5,137
Calcite,2.69-2.71,3,53
## Minetest 2017 API notes (see http://wiki.minetest.net/Groups and https://github.com/minetest/minetest/blob/142e2d3b74ad886eed83b0fc9d6cfea100dae10a/doc/lua_api.txt#L736 )
### groupcaps (in tool_capabilities dict in register_tool 2nd param dict): a dictionary of groupcap dictionaries such as:
* choppy: chops wood
* snappy: leaves and other thin materials -- possible with sword, but wears sword out quickly
* fleshy: damage mobs/players
* crumbly: shovels etc
* cracky: picks etc
(and more unrelated to this mod)
### register_node:
http://dev.minetest.net/minetest.register_node
http://dev.minetest.net/Groups
* groups.cracky: like other dig types, the value is normally 1 to 3, and 1 requires the best pick to mine.
* groups.level: prevents being mined by lower level stuff
## Authors and License
### Authors of source code
Changed listed above under "Changes in expertmm fork":
expertmm (github.com/expertmm) MIT License
Original code:
Doc22 (originally WTFPL)
### Authors of media (textures)
(see LICENSE.txt)
Textures from original (2012) version (1.2-git):
* Textures for axes, picks, mineral overlays, items (x.png where x is name), and blocks: by Doc22 (originally WTFPL as specified at https://forum.minetest.net/viewtopic.php?id=3663 , rereleased as CC BY-SA 3.0)
Textures for new tools (2016):
* Textures based on textures from minetest_game at https://github.com/minetest/minetest_game/tree/master/mods/default :
(source work is included on layers in Gimp XCF project files in etc folder)
Swords CC BY-SA 3.0: based on default_tool_steelsword.png by BlockMen (CC BY-SA 3.0)
Shovels CC BY-SA 3.0: based on default_tool_steelshovel.png by celeron55, Perttu Ahola <celeron55@gmail.com> (CC BY-SA 3.0)

44
aliases.lua Normal file
View File

@ -0,0 +1,44 @@
-- for backward compatibility (with birthstones 1.2-git [2012])
minetest.register_alias("birthstones:alexandrite_pick", "birthstones:pick_alexandrite")
minetest.register_alias("birthstones:amethyst_pick", "birthstones:pick_amethyst")
minetest.register_alias("birthstones:aquamarine_pick", "birthstones:pick_aquamarine")
minetest.register_alias("birthstones:diamond_pick", "birthstones:pick_diamond")
minetest.register_alias("birthstones:emerald_pick", "birthstones:pick_emerald")
minetest.register_alias("birthstones:garnet_pick", "birthstones:pick_garnet")
minetest.register_alias("birthstones:opal_pick", "birthstones:pick_opal")
minetest.register_alias("birthstones:peridot_pick", "birthstones:pick_peridot")
minetest.register_alias("birthstones:ruby_pick", "birthstones:pick_ruby")
minetest.register_alias("birthstones:sapphire_pick", "birthstones:pick_sapphire")
minetest.register_alias("birthstones:topaz_pick", "birthstones:pick_topaz")
minetest.register_alias("birthstones:zircon_pick", "birthstones:pick_zircon")
minetest.register_alias("birthstones:alexandrite_axe", "birthstones:axe_alexandrite")
minetest.register_alias("birthstones:amethyst_axe", "birthstones:axe_amethyst")
minetest.register_alias("birthstones:aquamarine_axe", "birthstones:axe_aquamarine")
minetest.register_alias("birthstones:diamond_axe", "birthstones:axe_diamond")
minetest.register_alias("birthstones:emerald_axe", "birthstones:axe_emerald")
minetest.register_alias("birthstones:garnet_axe", "birthstones:axe_garnet")
minetest.register_alias("birthstones:opal_axe", "birthstones:axe_opal")
minetest.register_alias("birthstones:peridot_axe", "birthstones:axe_peridot")
minetest.register_alias("birthstones:ruby_axe", "birthstones:axe_ruby")
minetest.register_alias("birthstones:sapphire_axe", "birthstones:axe_sapphire")
minetest.register_alias("birthstones:topaz_axe", "birthstones:axe_topaz")
minetest.register_alias("birthstones:zircon_axe", "birthstones:axe_zircon")
minetest.register_alias("birthstones:alexandriteore", "birthstones:stone_with_alexandrite")
minetest.register_alias("birthstones:amethystore", "birthstones:stone_with_amethyst")
minetest.register_alias("birthstones:aquamarineore", "birthstones:stone_with_aquamarine")
minetest.register_alias("birthstones:diamondore", "birthstones:stone_with_diamond")
minetest.register_alias("birthstones:emeraldore", "birthstones:stone_with_emerald")
minetest.register_alias("birthstones:garnetore", "birthstones:stone_with_garnet")
minetest.register_alias("birthstones:opalore", "birthstones:stone_with_opal")
minetest.register_alias("birthstones:peridotore", "birthstones:stone_with_peridot")
minetest.register_alias("birthstones:rubyore", "birthstones:stone_with_ruby")
minetest.register_alias("birthstones:sapphireore", "birthstones:stone_with_sapphire")
minetest.register_alias("birthstones:topazore", "birthstones:stone_with_topaz")
minetest.register_alias("birthstones:zirconore", "birthstones:stone_with_zircon")

28
crafting.lua Normal file
View File

@ -0,0 +1,28 @@
local function registerblockrecipe(name, blockname)
minetest.register_craft({
output = blockname,
recipe = {{name, name, name},
{name, name, name},
{name, name, name}
}
})
minetest.register_craft({
output = name..' 9',
recipe = {
{blockname},
}
})
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')

61
craftitems.lua Normal file
View File

@ -0,0 +1,61 @@
minetest.register_craftitem( "birthstones:alexandrite", {
description = "Alexandrite",
inventory_image = "birthstones_alexandrite.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:amethyst", {
description = "Amethyst",
inventory_image = "birthstones_amethyst.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:aquamarine", {
description = "Aquamarine",
inventory_image = "birthstones_aquamarine.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:diamond", {
description = "White Diamond",
inventory_image = "birthstones_diamond.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:emerald", {
description = "Emerald",
inventory_image = "birthstones_emerald.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:garnet", {
description = "Garnet",
inventory_image = "birthstones_garnet.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:opal", {
description = "Opal",
inventory_image = "birthstones_opal.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:peridot", {
description = "Peridot",
inventory_image = "birthstones_peridot.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:ruby", {
description = "Ruby",
inventory_image = "birthstones_ruby.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:sapphire", {
description = "Sapphire",
inventory_image = "birthstones_sapphire.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:topaz", {
description = "Topaz",
inventory_image = "birthstones_topaz.png",
on_place_on_ground = minetest.craftitem_place_item,
})
minetest.register_craftitem( "birthstones:zircon", {
description = "Zircon",
inventory_image = "Zircon.png",
on_place_on_ground = minetest.craftitem_place_item,
})

14
etc/birthstones list.csv Normal file
View File

@ -0,0 +1,14 @@
Month, birthstones-mod 2012 git, 2016 U.S.
January, !Alexandrite, Garnet
February, Amethyst, Amethyst
March, Aquamarine, Aquamarine
April, Diamond, Diamond
May, Emerald, Emerald
June, !Garnet, Alexandrite [see also Pearl]
July, !Opal, Ruby
August, Peridot, Peridot [see also Sardonyx or Spinel]
September, !Ruby, Sapphire
October, !Sapphire, Opal [see also Tourmaline]
November, Topaz, Topaz [see also Citrine]
December, Zircon, Zircon [see also Tanzanite or Turquoise]
SOURCE,birthstones-mod 2012 git by Doc22,https://www.americangemsociety.org/en/birthstones
1 Month birthstones-mod 2012 git 2016 U.S.
2 January !Alexandrite Garnet
3 February Amethyst Amethyst
4 March Aquamarine Aquamarine
5 April Diamond Diamond
6 May Emerald Emerald
7 June !Garnet Alexandrite [see also Pearl]
8 July !Opal Ruby
9 August Peridot Peridot [see also Sardonyx or Spinel]
10 September !Ruby Sapphire
11 October !Sapphire Opal [see also Tourmaline]
12 November Topaz Topaz [see also Citrine]
13 December Zircon Zircon [see also Tanzanite or Turquoise]
14 SOURCE birthstones-mod 2012 git by Doc22 https://www.americangemsociety.org/en/birthstones

BIN
etc/birthstones swords.xcf Normal file

Binary file not shown.

BIN
etc/birthstones_shovels.xcf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,25 @@
(see README for sources)
birthstones_tool_alexandriteshovel.png
birthstones_tool_alexandritesword.png
birthstones_tool_amethystshovel.png
birthstones_tool_amethystsword.png
birthstones_tool_aquamarineshovel.png
birthstones_tool_aquamarinesword.png
birthstones_tool_diamondshovel.png
birthstones_tool_diamondsword.png
birthstones_tool_emeraldshovel.png
birthstones_tool_emeraldsword.png
birthstones_tool_garnetshovel.png
birthstones_tool_garnetsword.png
birthstones_tool_opalshovel.png
birthstones_tool_opalsword.png
birthstones_tool_peridotshovel.png
birthstones_tool_peridotsword.png
birthstones_tool_rubyshovel.png
birthstones_tool_rubysword.png
birthstones_tool_sapphireshovel.png
birthstones_tool_sapphiresword.png
birthstones_tool_topazshovel.png
birthstones_tool_topazsword.png
birthstones_tool_zirconshovel.png
birthstones_tool_zirconsword.png

View File

@ -0,0 +1,15 @@
Name,Metric Density,Moh,Brinell
Alexandrite,3.74,~8,~461
Amethyst,2.65,7,178
Aquamarine,2.71,~5,~177
Diamond,3.515,10,~571
Emerald,2.725,~5,~180
Garnet,3.645,~8,~427
Opal,2.19,~4,94
Peridot,3.38,~7,~341
Ruby,4.0,9,667
Sapphire,4.0,9,667
Topaz,3.53,8,304
Zircon,4.33,~10,~713
,,,
See xlsx file for sources,,,
1 Name Metric Density Moh Brinell
2 Alexandrite 3.74 ~8 ~461
3 Amethyst 2.65 7 178
4 Aquamarine 2.71 ~5 ~177
5 Diamond 3.515 10 ~571
6 Emerald 2.725 ~5 ~180
7 Garnet 3.645 ~8 ~427
8 Opal 2.19 ~4 94
9 Peridot 3.38 ~7 ~341
10 Ruby 4.0 9 667
11 Sapphire 4.0 9 667
12 Topaz 3.53 8 304
13 Zircon 4.33 ~10 ~713
14
15 See xlsx file for sources

405
init.lua
View File

@ -1,399 +1,8 @@
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',
})
local birthstones_path = minetest.get_modpath("birthstones")
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 registerpickrecipe(name, durability, time1, time2, time3, maxlev)
minetest.register_tool("birthstones:".. name .. "_pick", {
description = name .. " Pickaxe",
inventory_image = name .. "_pick.png",
tool_capabilities = {
max_drop_level=0,
groupcaps={
cracky={times={[1]=time1, [2]=time2, [3]=time3}, uses=durability, maxlevel=maxlev}
}
},
})
minetest.register_tool("birthstones:"..name.."_axe", {
description = name.." Axe",
inventory_image = name.."_axe.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
choppy={times={[1]=time1-2.0, [2]=2.0-time2, [3]=2.0-time3}, uses=30, maxlevel=maxlev},
fleshy={times={[2]=time2, [3]=time3}, uses=40, maxlevel=maxlev}
}
},
})
minetest.register_craft({
output = "birthstones:"..name.."_pick",
recipe = {{'birthstones:'..name, 'birthstones:'..name, 'birthstones:'..name}, {'', 'default:stick', ''}, {'', 'default:stick', ''}}
})
minetest.register_craft({
output = "birthstones:"..name.."_axe",
recipe = {{'birthstones:'..name, 'birthstones:'..name}, {'birthstones:'..name, 'default:stick'}, {'', 'default:stick'}}
})
end
registerpickrecipe("zircon", 50, 4.1, 1.6, 1.05, 1)
registerpickrecipe("topaz", 38, 4.1, 1.6, 1.05, 1)
registerpickrecipe("sapphire", 40, 4.2, 1.6, 1.2, 1)
registerpickrecipe("ruby", 40, 4.2, 1.6, 1.2, 2)
registerpickrecipe("peridot", 34, 4.0, 1.5, 1.0, 1)
registerpickrecipe("opal", 32, 3.5, 1.6, 1.5, 2)
registerpickrecipe("garnet", 35, 4.0, 1.5, 1.0, 1)
registerpickrecipe("emerald", 40, 4.2, 1.6, 1.2, 2)
registerpickrecipe("diamond", 50, 4.5, 1.8, 1.3, 3)
registerpickrecipe("aquamarine", 25, 3.2, 1.40, 0.90, 1)
registerpickrecipe("amethyst", 30, 3.2, 1.40, 0.90, 1)
registerpickrecipe("alexandrite", 30, 3.2, 1.40, 0.90, 1)
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, 4, -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, 4, -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, 4, -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, 1, -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, 3, -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, 4, -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, 4, -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, 3, -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, 3, -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, 4, -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, 4, -31000, -70)
end)
dofile(birthstones_path.."/nodes.lua")
dofile(birthstones_path.."/craftitems.lua")
dofile(birthstones_path.."/crafting.lua")
dofile(birthstones_path.."/tools.lua")
dofile(birthstones_path.."/oregen.lua")
dofile(birthstones_path.."/aliases.lua")

188
nodes.lua Normal file
View File

@ -0,0 +1,188 @@
-- START RAW MATERIALS
minetest.register_node( "birthstones:stone_with_alexandrite", {
description = "Stone with Alexandrite",
tile_images = { "default_stone.png^birthstones_mineral_alexandrite.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:alexandrite",
})
minetest.register_node( "birthstones:stone_with_amethyst", {
description = "Stone with Amethyst",
tile_images = { "default_stone.png^birthstones_mineral_amethyst.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:amethyst",
})
minetest.register_node( "birthstones:stone_with_aquamarine", {
description = "Stone with Aquamarine",
tile_images = { "default_stone.png^birthstones_mineral_aquamarine.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:aquamarine",
})
minetest.register_node( "birthstones:stone_with_diamond", {
description = "Stone with White Diamond",
tile_images = { "default_stone.png^birthstones_mineral_diamond.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:diamond",
})
minetest.register_node( "birthstones:stone_with_emerald", {
description = "Stone with Emerald",
tile_images = { "default_stone.png^birthstones_mineral_emerald.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:emerald",
})
minetest.register_node( "birthstones:stone_with_garnet", {
description = "Stone with Garnet",
tile_images = { "default_stone.png^birthstones_mineral_garnet.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:garnet",
})
minetest.register_node( "birthstones:stone_with_opal", {
description = "Stone with Opal",
tile_images = { "default_stone.png^birthstones_mineral_opal.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:opal",
})
minetest.register_node( "birthstones:stone_with_peridot", {
description = "Stone with Peridot",
tile_images = { "default_stone.png^birthstones_mineral_peridot.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:peridot",
})
minetest.register_node( "birthstones:stone_with_ruby", {
description = "Stone with Ruby",
tile_images = { "default_stone.png^birthstones_mineral_ruby.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:ruby",
})
minetest.register_node( "birthstones:stone_with_sapphire", {
description = "Stone with Sapphire",
tile_images = { "default_stone.png^birthstones_mineral_sapphire.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:sapphire",
})
minetest.register_node( "birthstones:stone_with_topaz", {
description = "Stone with Topaz",
tile_images = { "default_stone.png^birthstones_mineral_topaz.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:topaz",
})
minetest.register_node( "birthstones:stone_with_zircon", {
description = "Stone with Zircon",
tile_images = { "default_stone.png^birthstones_mineral_zircon.png" },
is_ground_content = true,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
drop = "birthstones:zircon",
})
-- END RAW MATERIALS
-- START BLOCKS
minetest.register_node( "birthstones:alexandriteblock", {
description = "Alexandrite Block",
tile_images = { "birthstones_alexandrite_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:amethystblock", {
description = "Amethyst Block",
tile_images = { "birthstones_amethyst_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:aquamarineblock", {
description = "Aquamarine Block",
tile_images = { "birthstones_aquamarine_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:diamondblock", {
description = "White Diamond Block",
tile_images = { "birthstones_diamond_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:emeraldblock", {
description = "Emerald Block",
tile_images = { "birthstones_emerald_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:garnetblock", {
description = "Garnet Block",
tile_images = { "birthstones_garnet_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:opalblock", {
description = "Opal Block",
tile_images = { "birthstones_opal_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:peridotblock", {
description = "Peridot Block",
tile_images = { "birthstones_peridot_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:rubyblock", {
description = "Ruby Block",
tile_images = { "birthstones_ruby_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:sapphireblock", {
description = "Sapphire Block",
tile_images = { "birthstones_sapphire_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:topazblock", {
description = "Topaz Block",
tile_images = { "birthstones_topaz_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "birthstones:zirconblock", {
description = "Zircon Block",
tile_images = { "birthstones_zircon_block.png" },
is_ground_content = true,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_stone_defaults(),
})

76
oregen.lua Normal file
View File

@ -0,0 +1,76 @@
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:stone_with_alexandrite", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -40)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_amethyst", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -50)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_aquamarine", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -10)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_diamond", "default:stone", minp, maxp, seed+21, 1/10/10/10, 1, -31000, -300)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_emerald", "default:stone", minp, maxp, seed+21, 1/10/10/10, 3, -31000, -100)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_garnet", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -70)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_opal", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -60)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_peridot", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -60)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_ruby", "default:stone", minp, maxp, seed+21, 1/10/10/10, 3, -31000, -120)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_sapphire", "default:stone", minp, maxp, seed+21, 1/10/10/10, 3, -31000, -120)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_topaz", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -80)
end)
minetest.register_on_generated(function(minp, maxp, seed)
generate_ore("birthstones:stone_with_zircon", "default:stone", minp, maxp, seed+21, 1/10/10/10, 4, -31000, -70)
end)

View File

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

View File

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 289 B

View File

Before

Width:  |  Height:  |  Size: 441 B

After

Width:  |  Height:  |  Size: 441 B

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

View File

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

View File

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 211 B

View File

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 687 B

View File

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

View File

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 326 B

View File

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

View File

Before

Width:  |  Height:  |  Size: 503 B

After

Width:  |  Height:  |  Size: 503 B

View File

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

View File

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

View File

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 236 B

View File

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

View File

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 317 B

View File

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

View File

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

View File

Before

Width:  |  Height:  |  Size: 755 B

After

Width:  |  Height:  |  Size: 755 B

View File

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 225 B

View File

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 296 B

View File

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 253 B

View File

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 897 B

View File

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

View File

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 453 B

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

View File

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

View File

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 143 B

View File

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

View File

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

View File

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 132 B

View File

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View File

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

View File

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

View File

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

View File

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 134 B

View File

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

View File

Before

Width:  |  Height:  |  Size: 154 B

After

Width:  |  Height:  |  Size: 154 B

View File

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

View File

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

View File

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 235 B

View File

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

View File

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 229 B

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

166
tools.lua Normal file
View File

@ -0,0 +1,166 @@
-- START OF FUNCTIONS
-- (START OF INIT IS FURTHER DOWN)
local function registerpickrecipe(name, durability, time1, time2, time3, maxlev)
minetest.register_tool("birthstones:pick_"..strlower(name), {
description = name .. " Pickaxe",
inventory_image = "birthstones_tool_"..strlower(name).. "pick.png",
tool_capabilities = {
max_drop_level=0,
groupcaps={
cracky={times={[1]=time1, [2]=time2, [3]=time3}, uses=durability, maxlevel=maxlev}
}
},
})
minetest.register_craft({
output = "birthstones:pick_"..strlower(name),
recipe = {
{'birthstones:'..strlower(name), 'birthstones:'..strlower(name), 'birthstones:'..strlower(name)},
{'', 'default:stick', ''},
{'', 'default:stick', ''}
}
})
minetest.register_tool("birthstones:axe_"..strlower(name), {
description = name.." Axe",
inventory_image = "birthstones_tool_"..strlower(name).."axe.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
choppy={times={[1]=time1/2.0, [2]=time2/2.0, [3]=time3/2.0}, uses=30, maxlevel=maxlev},
fleshy={times={[2]=time2, [3]=time3}, uses=40, maxlevel=maxlev}
}
},
})
minetest.register_craft({
output = "birthstones:axe_"..strlower(name),
recipe = {
{'birthstones:'..strlower(name), 'birthstones:'..strlower(name)},
{'birthstones:'..strlower(name), 'default:stick'},
{'', 'default:stick'}
}
})
minetest.register_tool("birthstones:shovel_"..strlower(name), {
description = name.." Shovel",
inventory_image = "birthstones_tool_"..strlower(name).."shovel.png",
wield_image = "birthstones_tool_"..strlower(name).."shovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
output = "birthstones:shovel_"..strlower(name),
recipe = {
{'', 'birthstones:'..strlower(name)},
{'', 'default:stick'},
{'', 'default:stick'}
}
})
end
local function registerswordrecipe(name)
minetest.register_tool("birthstones:sword_"..strlower(name), {
description = name.." Pickaxe",
inventory_image = "birthstones_tool_"..strlower(name).."pick.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=5},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
output = "birthstones:sword_"..strlower(name),
recipe = {
{'', 'birthstones:'..strlower(name)},
{'', 'birthstones:'..strlower(name)},
{'', 'default:stick'}
}
})
end
-- END OF FUNCTIONS
-- START OF INIT
registerswordrecipe("Alexandrite")
registerswordrecipe("Amethyst")
registerswordrecipe("Aquamarine")
-- NOTE: Diamond is done manually below so as to be named White Diamond
registerswordrecipe("Emerald")
registerswordrecipe("Garnet")
registerswordrecipe("Opal")
registerswordrecipe("Peridot")
registerswordrecipe("Ruby")
registerswordrecipe("Sapphire")
registerswordrecipe("Topaz")
registerswordrecipe("Zircon")
minetest.register_tool("birthstones:sword_diamond", {
description = "White Diamond Sword",
inventory_image = "birthstones_tool_diamondsword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
output = "birthstones:sword_diamond",
recipe = {
{'', 'birthstones:diamond'},
{'', 'birthstones:diamond'},
{'', 'default:stick'}
}
})
minetest.register_tool("birthstones:shovel_diamond", {
description = "White Diamond Shovel",
inventory_image = "birthstones_tool_diamondshovel.png",
wield_image = "birthstones_tool_diamondshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
output = "birthstones:shovel_diamond",
recipe = {
{'', 'birthstones:diamond'},
{'', 'default:stick'},
{'', 'default:stick'}
}
})
-- name, durability, time1, time2, time3, maxlev
registerpickrecipe("Alexandrite", 30, 3.2, 1.40, 0.90, 1)
registerpickrecipe("Amethyst", 30, 3.2, 1.40, 0.90, 1)
registerpickrecipe("Aquamarine", 25, 3.2, 1.40, 0.90, 1)
registerpickrecipe("Diamond", 50, 4.5, 1.8, 1.3, 3)
registerpickrecipe("Emerald", 40, 4.2, 1.6, 1.2, 2)
registerpickrecipe("Garnet", 35, 4.0, 1.5, 1.0, 1)
registerpickrecipe("Opal", 32, 3.5, 1.6, 1.5, 2)
registerpickrecipe("Peridot", 34, 4.0, 1.5, 1.0, 1)
registerpickrecipe("Ruby", 40, 4.2, 1.6, 1.2, 2)
registerpickrecipe("Sapphire", 40, 4.2, 1.6, 1.2, 1)
registerpickrecipe("Topaz", 38, 4.1, 1.6, 1.05, 1)
registerpickrecipe("Zircon", 50, 4.1, 1.6, 1.05, 1)