summaryrefslogtreecommitdiff
path: root/plantlife_modpack/molehills/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 20:02:19 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 21:09:33 -0400
commitda66780a569712c23ae4f2996cfb4608a9f9d69d (patch)
tree217556029a78bc23ad4564720afc86de97228a04 /plantlife_modpack/molehills/init.lua
parent615b22df4d423aded3613db7716943a2f389b047 (diff)
downloaddreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.gz
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.bz2
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.xz
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.zip
copy all standard Dreambuilder mods in from the old subgame
(exactly as last supplied there, updates to these mods will follow later)
Diffstat (limited to 'plantlife_modpack/molehills/init.lua')
-rw-r--r--plantlife_modpack/molehills/init.lua78
1 files changed, 78 insertions, 0 deletions
diff --git a/plantlife_modpack/molehills/init.lua b/plantlife_modpack/molehills/init.lua
new file mode 100644
index 0000000..d0a1941
--- /dev/null
+++ b/plantlife_modpack/molehills/init.lua
@@ -0,0 +1,78 @@
+-----------------------------------------------------------------------------------------------
+local title = "Mole Hills"
+local version = "0.0.3"
+local mname = "molehills"
+-----------------------------------------------------------------------------------------------
+-- Idea by Sokomine
+-- Code & textures by Mossmanikin
+
+abstract_molehills = {}
+
+dofile(minetest.get_modpath("molehills").."/molehills_settings.txt")
+
+-----------------------------------------------------------------------------------------------
+-- NoDe
+-----------------------------------------------------------------------------------------------
+
+local mh_cbox = {
+ type = "fixed",
+ fixed = { -0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
+}
+
+minetest.register_node("molehills:molehill",{
+ drawtype = "mesh",
+ mesh = "molehill_molehill.obj",
+ description = "Mole Hill",
+ inventory_image = "molehills_side.png",
+ tiles = { "molehills_dirt.png" },
+ paramtype = "light",
+ selection_box = mh_cbox,
+ collision_box = mh_cbox,
+ groups = {crumbly=3},
+ sounds = default.node_sound_dirt_defaults(),
+})
+
+-----------------------------------------------------------------------------------------------
+-- CRaFTiNG
+-----------------------------------------------------------------------------------------------
+minetest.register_craft({ -- molehills --> dirt
+ output = "default:dirt",
+ recipe = {
+ {"molehills:molehill","molehills:molehill"},
+ {"molehills:molehill","molehills:molehill"},
+ }
+})
+
+-----------------------------------------------------------------------------------------------
+-- GeNeRaTiNG
+-----------------------------------------------------------------------------------------------
+abstract_molehills.place_molehill = function(pos)
+ local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
+ if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }).name ~= "air"
+ and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }).name ~= "air"
+ and minetest.get_node({x=pos.x , y=pos.y, z=pos.z+1}).name ~= "air"
+ and minetest.get_node({x=pos.x , y=pos.y, z=pos.z-1}).name ~= "air"
+ and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}).name ~= "air"
+ and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}).name ~= "air"
+ and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}).name ~= "air"
+ and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z-1}).name ~= "air" then
+ minetest.set_node(right_here, {name="molehills:molehill"})
+ end
+end
+
+biome_lib:register_generate_plant({
+ surface = {"default:dirt_with_grass"},
+ max_count = Molehills_Max_Count,
+ rarity = Molehills_Rarity,
+ min_elevation = 1,
+ max_elevation = 40,
+ avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]},
+ avoid_radius = 4,
+ plantlife_limit = -0.3,
+ },
+ abstract_molehills.place_molehill
+)
+
+-----------------------------------------------------------------------------------------------
+print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
+-----------------------------------------------------------------------------------------------