diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..8a565df --- /dev/null +++ b/Readme.md @@ -0,0 +1,33 @@ +# Geodes Library + +Register a geode: + +geodes_lib:register_geode({ + wherein = node in which geodes generate, set to mapgen_stone unless you need it to spawn in a specific place, + y_min = minimum level at which geodes generate, + y_max = maximum level at which geodes generate, + scarcity = rarity of geodes, rarest at 80, lower values not recommended unless you use generation chance, + core = node comprising innermost part of geode, usually a crystal such as amethyst, + core_alt = replacement for node comprising innermost part of geode, usually a budding node which spawns plantlike drawtype crystal nodes on all sides, + core_alt_chance = chance of core_alt replacing core, + shell = array of nodes comprising geode shell, from outermost to innermost, + radius_min = minimum radius of geode cavity, + radius_max = maximum radius of geode cavity, + generation_chance = % chance a geode spawns given other conditions, lets geodes be even rarer, +}) + +Example: + +geodes_lib:register_geode({ + wherein = "mapgen_stone", + y_min = -31000, + y_max = -10, + scarcity = 80, + core = "modname:citrine", + core_alt = "modname:citrine_budding", + core_alt_chance = 100, + shell = {"modname:limestone", "modname:calcite"}, + radius_min = 2, + radius_max = 10, + generation_chance = 50, -- set to around 10 if you are adding 20 or more geodes this way +}) diff --git a/init.lua b/init.lua index cb0ce6c..bd208e6 100644 --- a/init.lua +++ b/init.lua @@ -60,10 +60,7 @@ function geodes_lib:register_geode(data) local shell = data.shell local radius_min = data.radius_min local radius_max = data.radius_max - local generation_chance = data.generation_chance or 100-- added line - --[[if not generation_chance or type(generation_chance) ~= "number" or generation_chance <= 0 then - generation_chance = 100 -end--]] + local generation_chance = data.generation_chance or 100 minetest.register_node(core.."_technical_mapgen", { }) diff --git a/license.txt b/license.txt index 369b3e7..87c106e 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,5 @@ Parts of code are taken from geodes mod by AwesomeDragon97, licensed under LGPL3.0 +Additions by backdaniel and JoeEnderman GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/mod.conf b/mod.conf index e0c87e5..d13d544 100644 --- a/mod.conf +++ b/mod.conf @@ -1,5 +1,4 @@ name=geodes_lib -release = 16620 author = alerikaisattera description = API/library for creating geodes title = Geodes Library