diff --git a/Hardness Calculator.xlsx b/Hardness Calculator.xlsx new file mode 100644 index 0000000..bc2a952 Binary files /dev/null and b/Hardness Calculator.xlsx differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ee8aac1 --- /dev/null +++ b/LICENSE.txt @@ -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/ diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..b77c7f6 --- /dev/null +++ b/README.txt @@ -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 (CC BY-SA 3.0) + diff --git a/aliases.lua b/aliases.lua new file mode 100644 index 0000000..708a20d --- /dev/null +++ b/aliases.lua @@ -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") + diff --git a/crafting.lua b/crafting.lua new file mode 100644 index 0000000..6b7fce8 --- /dev/null +++ b/crafting.lua @@ -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') diff --git a/craftitems.lua b/craftitems.lua new file mode 100644 index 0000000..460f627 --- /dev/null +++ b/craftitems.lua @@ -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, +}) + diff --git a/etc/birthstones list.csv b/etc/birthstones list.csv new file mode 100644 index 0000000..8269bcb --- /dev/null +++ b/etc/birthstones list.csv @@ -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 \ No newline at end of file diff --git a/etc/birthstones swords.xcf b/etc/birthstones swords.xcf new file mode 100644 index 0000000..07bb425 Binary files /dev/null and b/etc/birthstones swords.xcf differ diff --git a/etc/birthstones_shovels.xcf b/etc/birthstones_shovels.xcf new file mode 100644 index 0000000..79eacf3 Binary files /dev/null and b/etc/birthstones_shovels.xcf differ diff --git a/etc/diamond Brinell forecast.jpg b/etc/diamond Brinell forecast.jpg new file mode 100644 index 0000000..034d724 Binary files /dev/null and b/etc/diamond Brinell forecast.jpg differ diff --git a/expertmm_authored_texture_list.txt b/expertmm_authored_texture_list.txt new file mode 100644 index 0000000..511198c --- /dev/null +++ b/expertmm_authored_texture_list.txt @@ -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 diff --git a/hardness - extrapolated.csv b/hardness - extrapolated.csv new file mode 100644 index 0000000..53b06db --- /dev/null +++ b/hardness - extrapolated.csv @@ -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,,, \ No newline at end of file diff --git a/init.lua b/init.lua index aaa88f6..0994d9f 100644 --- a/init.lua +++ b/init.lua @@ -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) \ No newline at end of file +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") diff --git a/nodes.lua b/nodes.lua new file mode 100644 index 0000000..98e5ee1 --- /dev/null +++ b/nodes.lua @@ -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(), +}) \ No newline at end of file diff --git a/oregen.lua b/oregen.lua new file mode 100644 index 0000000..2209cb6 --- /dev/null +++ b/oregen.lua @@ -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) diff --git a/textures/Alexandrite.png b/textures/birthstones_alexandrite.png similarity index 100% rename from textures/Alexandrite.png rename to textures/birthstones_alexandrite.png diff --git a/textures/Alexandrite_block.png b/textures/birthstones_alexandrite_block.png similarity index 100% rename from textures/Alexandrite_block.png rename to textures/birthstones_alexandrite_block.png diff --git a/textures/Amethyst.png b/textures/birthstones_amethyst.png similarity index 100% rename from textures/Amethyst.png rename to textures/birthstones_amethyst.png diff --git a/textures/Amethyst_block.png b/textures/birthstones_amethyst_block.png similarity index 100% rename from textures/Amethyst_block.png rename to textures/birthstones_amethyst_block.png diff --git a/textures/Aquamarine.png b/textures/birthstones_aquamarine.png similarity index 100% rename from textures/Aquamarine.png rename to textures/birthstones_aquamarine.png diff --git a/textures/Aquamarine_block.png b/textures/birthstones_aquamarine_block.png similarity index 100% rename from textures/Aquamarine_block.png rename to textures/birthstones_aquamarine_block.png diff --git a/textures/Diamond.png b/textures/birthstones_diamond.png similarity index 100% rename from textures/Diamond.png rename to textures/birthstones_diamond.png diff --git a/textures/Diamond_block.png b/textures/birthstones_diamond_block.png similarity index 100% rename from textures/Diamond_block.png rename to textures/birthstones_diamond_block.png diff --git a/textures/Emerald.png b/textures/birthstones_emerald.png similarity index 100% rename from textures/Emerald.png rename to textures/birthstones_emerald.png diff --git a/textures/Emerald_block.png b/textures/birthstones_emerald_block.png similarity index 100% rename from textures/Emerald_block.png rename to textures/birthstones_emerald_block.png diff --git a/textures/Garnet.png b/textures/birthstones_garnet.png similarity index 100% rename from textures/Garnet.png rename to textures/birthstones_garnet.png diff --git a/textures/Garnet_block.png b/textures/birthstones_garnet_block.png similarity index 100% rename from textures/Garnet_block.png rename to textures/birthstones_garnet_block.png diff --git a/textures/Alexandrite_overlay.png b/textures/birthstones_mineral_alexandrite.png similarity index 100% rename from textures/Alexandrite_overlay.png rename to textures/birthstones_mineral_alexandrite.png diff --git a/textures/Amethyst_overlay.png b/textures/birthstones_mineral_amethyst.png similarity index 100% rename from textures/Amethyst_overlay.png rename to textures/birthstones_mineral_amethyst.png diff --git a/textures/Aquamarine_overlay.png b/textures/birthstones_mineral_aquamarine.png similarity index 100% rename from textures/Aquamarine_overlay.png rename to textures/birthstones_mineral_aquamarine.png diff --git a/textures/Diamond_overlay.png b/textures/birthstones_mineral_diamond.png similarity index 100% rename from textures/Diamond_overlay.png rename to textures/birthstones_mineral_diamond.png diff --git a/textures/Emerald_overlay.png b/textures/birthstones_mineral_emerald.png similarity index 100% rename from textures/Emerald_overlay.png rename to textures/birthstones_mineral_emerald.png diff --git a/textures/Garnet_overlay.png b/textures/birthstones_mineral_garnet.png similarity index 100% rename from textures/Garnet_overlay.png rename to textures/birthstones_mineral_garnet.png diff --git a/textures/Opal_overlay.png b/textures/birthstones_mineral_opal.png similarity index 100% rename from textures/Opal_overlay.png rename to textures/birthstones_mineral_opal.png diff --git a/textures/Peridot_overlay.png b/textures/birthstones_mineral_peridot.png similarity index 100% rename from textures/Peridot_overlay.png rename to textures/birthstones_mineral_peridot.png diff --git a/textures/Ruby_overlay.png b/textures/birthstones_mineral_ruby.png similarity index 100% rename from textures/Ruby_overlay.png rename to textures/birthstones_mineral_ruby.png diff --git a/textures/Sapphire_overlay.png b/textures/birthstones_mineral_sapphire.png similarity index 100% rename from textures/Sapphire_overlay.png rename to textures/birthstones_mineral_sapphire.png diff --git a/textures/Topaz_overlay.png b/textures/birthstones_mineral_topaz.png similarity index 100% rename from textures/Topaz_overlay.png rename to textures/birthstones_mineral_topaz.png diff --git a/textures/Zircon_overlay.png b/textures/birthstones_mineral_zircon.png similarity index 100% rename from textures/Zircon_overlay.png rename to textures/birthstones_mineral_zircon.png diff --git a/textures/Opal.png b/textures/birthstones_opal.png similarity index 100% rename from textures/Opal.png rename to textures/birthstones_opal.png diff --git a/textures/Opal_block.png b/textures/birthstones_opal_block.png similarity index 100% rename from textures/Opal_block.png rename to textures/birthstones_opal_block.png diff --git a/textures/Peridot.png b/textures/birthstones_peridot.png similarity index 100% rename from textures/Peridot.png rename to textures/birthstones_peridot.png diff --git a/textures/Peridot_block.png b/textures/birthstones_peridot_block.png similarity index 100% rename from textures/Peridot_block.png rename to textures/birthstones_peridot_block.png diff --git a/textures/Ruby.png b/textures/birthstones_ruby.png similarity index 100% rename from textures/Ruby.png rename to textures/birthstones_ruby.png diff --git a/textures/Ruby_block.png b/textures/birthstones_ruby_block.png similarity index 100% rename from textures/Ruby_block.png rename to textures/birthstones_ruby_block.png diff --git a/textures/Sapphire.png b/textures/birthstones_sapphire.png similarity index 100% rename from textures/Sapphire.png rename to textures/birthstones_sapphire.png diff --git a/textures/Sapphire_block.png b/textures/birthstones_sapphire_block.png similarity index 100% rename from textures/Sapphire_block.png rename to textures/birthstones_sapphire_block.png diff --git a/textures/alexandrite_axe.png b/textures/birthstones_tool_alexandriteaxe.png similarity index 100% rename from textures/alexandrite_axe.png rename to textures/birthstones_tool_alexandriteaxe.png diff --git a/textures/alexandrite_pick.png b/textures/birthstones_tool_alexandritepick.png similarity index 100% rename from textures/alexandrite_pick.png rename to textures/birthstones_tool_alexandritepick.png diff --git a/textures/birthstones_tool_alexandriteshovel.png b/textures/birthstones_tool_alexandriteshovel.png new file mode 100644 index 0000000..9358bd1 Binary files /dev/null and b/textures/birthstones_tool_alexandriteshovel.png differ diff --git a/textures/birthstones_tool_alexandritesword.png b/textures/birthstones_tool_alexandritesword.png new file mode 100644 index 0000000..09890ab Binary files /dev/null and b/textures/birthstones_tool_alexandritesword.png differ diff --git a/textures/amethyst_axe.png b/textures/birthstones_tool_amethystaxe.png similarity index 100% rename from textures/amethyst_axe.png rename to textures/birthstones_tool_amethystaxe.png diff --git a/textures/amethyst_pick.png b/textures/birthstones_tool_amethystpick.png similarity index 100% rename from textures/amethyst_pick.png rename to textures/birthstones_tool_amethystpick.png diff --git a/textures/birthstones_tool_amethystshovel.png b/textures/birthstones_tool_amethystshovel.png new file mode 100644 index 0000000..1041b05 Binary files /dev/null and b/textures/birthstones_tool_amethystshovel.png differ diff --git a/textures/birthstones_tool_amethystsword.png b/textures/birthstones_tool_amethystsword.png new file mode 100644 index 0000000..7364505 Binary files /dev/null and b/textures/birthstones_tool_amethystsword.png differ diff --git a/textures/aquamarine_axe.png b/textures/birthstones_tool_aquamarineaxe.png similarity index 100% rename from textures/aquamarine_axe.png rename to textures/birthstones_tool_aquamarineaxe.png diff --git a/textures/aquamarine_pick.png b/textures/birthstones_tool_aquamarinepick.png similarity index 100% rename from textures/aquamarine_pick.png rename to textures/birthstones_tool_aquamarinepick.png diff --git a/textures/birthstones_tool_aquamarineshovel.png b/textures/birthstones_tool_aquamarineshovel.png new file mode 100644 index 0000000..6547e93 Binary files /dev/null and b/textures/birthstones_tool_aquamarineshovel.png differ diff --git a/textures/birthstones_tool_aquamarinesword.png b/textures/birthstones_tool_aquamarinesword.png new file mode 100644 index 0000000..7297037 Binary files /dev/null and b/textures/birthstones_tool_aquamarinesword.png differ diff --git a/textures/diamond_axe.png b/textures/birthstones_tool_diamondaxe.png similarity index 100% rename from textures/diamond_axe.png rename to textures/birthstones_tool_diamondaxe.png diff --git a/textures/diamond_pick.png b/textures/birthstones_tool_diamondpick.png similarity index 100% rename from textures/diamond_pick.png rename to textures/birthstones_tool_diamondpick.png diff --git a/textures/birthstones_tool_diamondshovel.png b/textures/birthstones_tool_diamondshovel.png new file mode 100644 index 0000000..72e8e35 Binary files /dev/null and b/textures/birthstones_tool_diamondshovel.png differ diff --git a/textures/birthstones_tool_diamondsword.png b/textures/birthstones_tool_diamondsword.png new file mode 100644 index 0000000..47a3028 Binary files /dev/null and b/textures/birthstones_tool_diamondsword.png differ diff --git a/textures/emerald_axe.png b/textures/birthstones_tool_emeraldaxe.png similarity index 100% rename from textures/emerald_axe.png rename to textures/birthstones_tool_emeraldaxe.png diff --git a/textures/emerald_pick.png b/textures/birthstones_tool_emeraldpick.png similarity index 100% rename from textures/emerald_pick.png rename to textures/birthstones_tool_emeraldpick.png diff --git a/textures/birthstones_tool_emeraldshovel.png b/textures/birthstones_tool_emeraldshovel.png new file mode 100644 index 0000000..81916d9 Binary files /dev/null and b/textures/birthstones_tool_emeraldshovel.png differ diff --git a/textures/birthstones_tool_emeraldsword.png b/textures/birthstones_tool_emeraldsword.png new file mode 100644 index 0000000..b39d679 Binary files /dev/null and b/textures/birthstones_tool_emeraldsword.png differ diff --git a/textures/garnet_axe.png b/textures/birthstones_tool_garnetaxe.png similarity index 100% rename from textures/garnet_axe.png rename to textures/birthstones_tool_garnetaxe.png diff --git a/textures/garnet_pick.png b/textures/birthstones_tool_garnetpick.png similarity index 100% rename from textures/garnet_pick.png rename to textures/birthstones_tool_garnetpick.png diff --git a/textures/birthstones_tool_garnetshovel.png b/textures/birthstones_tool_garnetshovel.png new file mode 100644 index 0000000..0e44322 Binary files /dev/null and b/textures/birthstones_tool_garnetshovel.png differ diff --git a/textures/birthstones_tool_garnetsword.png b/textures/birthstones_tool_garnetsword.png new file mode 100644 index 0000000..5d36b6a Binary files /dev/null and b/textures/birthstones_tool_garnetsword.png differ diff --git a/textures/opal_axe.png b/textures/birthstones_tool_opalaxe.png similarity index 100% rename from textures/opal_axe.png rename to textures/birthstones_tool_opalaxe.png diff --git a/textures/opal_pick.png b/textures/birthstones_tool_opalpick.png similarity index 100% rename from textures/opal_pick.png rename to textures/birthstones_tool_opalpick.png diff --git a/textures/birthstones_tool_opalshovel.png b/textures/birthstones_tool_opalshovel.png new file mode 100644 index 0000000..6a4f928 Binary files /dev/null and b/textures/birthstones_tool_opalshovel.png differ diff --git a/textures/birthstones_tool_opalsword.png b/textures/birthstones_tool_opalsword.png new file mode 100644 index 0000000..f5673df Binary files /dev/null and b/textures/birthstones_tool_opalsword.png differ diff --git a/textures/peridot_axe.png b/textures/birthstones_tool_peridotaxe.png similarity index 100% rename from textures/peridot_axe.png rename to textures/birthstones_tool_peridotaxe.png diff --git a/textures/peridot_pick.png b/textures/birthstones_tool_peridotpick.png similarity index 100% rename from textures/peridot_pick.png rename to textures/birthstones_tool_peridotpick.png diff --git a/textures/birthstones_tool_peridotshovel.png b/textures/birthstones_tool_peridotshovel.png new file mode 100644 index 0000000..e2b677c Binary files /dev/null and b/textures/birthstones_tool_peridotshovel.png differ diff --git a/textures/birthstones_tool_peridotsword.png b/textures/birthstones_tool_peridotsword.png new file mode 100644 index 0000000..4e232eb Binary files /dev/null and b/textures/birthstones_tool_peridotsword.png differ diff --git a/textures/ruby_axe.png b/textures/birthstones_tool_rubyaxe.png similarity index 100% rename from textures/ruby_axe.png rename to textures/birthstones_tool_rubyaxe.png diff --git a/textures/ruby_pick.png b/textures/birthstones_tool_rubypick.png similarity index 100% rename from textures/ruby_pick.png rename to textures/birthstones_tool_rubypick.png diff --git a/textures/birthstones_tool_rubyshovel.png b/textures/birthstones_tool_rubyshovel.png new file mode 100644 index 0000000..cb2eac2 Binary files /dev/null and b/textures/birthstones_tool_rubyshovel.png differ diff --git a/textures/birthstones_tool_rubysword.png b/textures/birthstones_tool_rubysword.png new file mode 100644 index 0000000..2c6b539 Binary files /dev/null and b/textures/birthstones_tool_rubysword.png differ diff --git a/textures/sapphire_axe.png b/textures/birthstones_tool_sapphireaxe.png similarity index 100% rename from textures/sapphire_axe.png rename to textures/birthstones_tool_sapphireaxe.png diff --git a/textures/sapphire_pick.png b/textures/birthstones_tool_sapphirepick.png similarity index 100% rename from textures/sapphire_pick.png rename to textures/birthstones_tool_sapphirepick.png diff --git a/textures/birthstones_tool_sapphireshovel.png b/textures/birthstones_tool_sapphireshovel.png new file mode 100644 index 0000000..a60678e Binary files /dev/null and b/textures/birthstones_tool_sapphireshovel.png differ diff --git a/textures/birthstones_tool_sapphiresword.png b/textures/birthstones_tool_sapphiresword.png new file mode 100644 index 0000000..ec33ea2 Binary files /dev/null and b/textures/birthstones_tool_sapphiresword.png differ diff --git a/textures/topaz_axe.png b/textures/birthstones_tool_topazaxe.png similarity index 100% rename from textures/topaz_axe.png rename to textures/birthstones_tool_topazaxe.png diff --git a/textures/topaz_pick.png b/textures/birthstones_tool_topazpick.png similarity index 100% rename from textures/topaz_pick.png rename to textures/birthstones_tool_topazpick.png diff --git a/textures/birthstones_tool_topazshovel.png b/textures/birthstones_tool_topazshovel.png new file mode 100644 index 0000000..1be437b Binary files /dev/null and b/textures/birthstones_tool_topazshovel.png differ diff --git a/textures/birthstones_tool_topazsword.png b/textures/birthstones_tool_topazsword.png new file mode 100644 index 0000000..239414b Binary files /dev/null and b/textures/birthstones_tool_topazsword.png differ diff --git a/textures/zircon_axe.png b/textures/birthstones_tool_zirconaxe.png similarity index 100% rename from textures/zircon_axe.png rename to textures/birthstones_tool_zirconaxe.png diff --git a/textures/zircon_pick.png b/textures/birthstones_tool_zirconpick.png similarity index 100% rename from textures/zircon_pick.png rename to textures/birthstones_tool_zirconpick.png diff --git a/textures/birthstones_tool_zirconshovel.png b/textures/birthstones_tool_zirconshovel.png new file mode 100644 index 0000000..b3db015 Binary files /dev/null and b/textures/birthstones_tool_zirconshovel.png differ diff --git a/textures/birthstones_tool_zirconsword.png b/textures/birthstones_tool_zirconsword.png new file mode 100644 index 0000000..71e2262 Binary files /dev/null and b/textures/birthstones_tool_zirconsword.png differ diff --git a/textures/Topaz.png b/textures/birthstones_topaz.png similarity index 100% rename from textures/Topaz.png rename to textures/birthstones_topaz.png diff --git a/textures/Topaz_block.png b/textures/birthstones_topaz_block.png similarity index 100% rename from textures/Topaz_block.png rename to textures/birthstones_topaz_block.png diff --git a/textures/Zircon.png b/textures/birthstones_zircon.png similarity index 100% rename from textures/Zircon.png rename to textures/birthstones_zircon.png diff --git a/textures/Zircon_block.png b/textures/birthstones_zircon_block.png similarity index 100% rename from textures/Zircon_block.png rename to textures/birthstones_zircon_block.png diff --git a/tools.lua b/tools.lua new file mode 100644 index 0000000..cfb06c2 --- /dev/null +++ b/tools.lua @@ -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)