From a54fb59a0e70fc70e141486b68c1b0fa5ed3b573 Mon Sep 17 00:00:00 2001
From: TenPlus1 <kinsellaja@yahoo.com>
Date: Sat, 7 Jan 2017 18:28:54 +0000
Subject: [PATCH] added coral and silver sand (minetest 0.4.15 only)

---
 README.md   |  1 +
 crystal.lua |  1 +
 init.lua    |  2 +-
 mapgen.lua  | 41 +++++++++++++++++++++++++++++++++++++++--
 water.lua   |  1 +
 5 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 4f8beac..786e64e 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,7 @@ Ethereal Mapgen mod for Minetest (works on all except v6)
  - Added default Abm overrides
  - Added 4 new plants from baked clay mod to mapgen
  - Added swamp biome to outskirts of bamboo areas
+ - Added coral and silver sand to mapgen (0.4.15 only)
 
 ### 1.20
 
diff --git a/crystal.lua b/crystal.lua
index 91aac19..e3782f6 100644
--- a/crystal.lua
+++ b/crystal.lua
@@ -194,6 +194,7 @@ minetest.register_tool("ethereal:shovel_crystal", {
 			minetest.remove_node(pointed_thing.under)
 
 			nodeupdate(pos)
+			--minetest.check_for_falling(pos)
 
 			if minetest.setting_getbool("creative_mode") then
 
diff --git a/init.lua b/init.lua
index 6b43d2d..f9ffdd4 100644
--- a/init.lua
+++ b/init.lua
@@ -1,6 +1,6 @@
 --[[
 
-	Minetest Ethereal Mod (6th December 2016)
+	Minetest Ethereal Mod (7th January 2017)
 
 	Created by ChinChow
 
diff --git a/mapgen.lua b/mapgen.lua
index 57d1933..f2fd482 100644
--- a/mapgen.lua
+++ b/mapgen.lua
@@ -136,8 +136,13 @@ add_biome("caves", nil, "default:desert_stone", 3, "air", 8,
 add_biome("grayness", nil, "ethereal:gray_dirt", 1, "default:dirt", 3,
 	nil, nil, nil, nil, nil, 2, 41, 15, 30, ethereal.grayness)
 
-add_biome("grayness_ocean", nil, "default:sand", 1, "default:sand", 2,
-	nil, nil, nil, nil, nil, -192, 1, 15, 30, ethereal.grayness)
+if minetest.registered_nodes["default:silver_sand"] then
+	add_biome("grayness_ocean", nil, "default:silver_sand", 2, "default:sand", 2,
+		nil, nil, nil, nil, nil, -192, 1, 15, 30, ethereal.grayness)
+else
+	add_biome("grayness_ocean", nil, "default:sand", 1, "default:sand", 2,
+		nil, nil, nil, nil, nil, -192, 1, 15, 30, ethereal.grayness)
+end
 
 add_biome("grassytwo", nil, "ethereal:green_dirt", 1, "default:dirt", 3,
 	nil, nil, nil, nil, nil, 1, 91, 15, 40, ethereal.grassytwo)
@@ -576,6 +581,38 @@ minetest.register_on_generated(function(minp, maxp)
 	end
 end)
 
+-- coral reef (0.4.15 only)
+if minetest.registered_nodes["default:coral_orange"] then
+
+-- override corals so crystal shovel can pick them up intact
+minetest.override_item("default:coral_skeleton", {groups = {crumbly = 3}})
+minetest.override_item("default:coral_orange", {groups = {crumbly = 3}})
+minetest.override_item("default:coral_brown", {groups = {crumbly = 3}})
+
+	minetest.register_decoration({
+		deco_type = "schematic",
+		place_on = {"default:sand"},
+		noise_params = {
+			offset = -0.1,
+			scale = 0.1,
+			spread = {x = 200, y = 200, z = 200},
+			seed = 7013,
+			octaves = 3,
+			persist = 1,
+		},
+		biomes = {
+			"desert_ocean",
+			"grove_ocean",
+		},
+		y_min = -8,
+		y_max = -2,
+		schematic = dpath .. "corals.mts",
+		flags = "place_center_x, place_center_z",
+		rotation = "random",
+	})
+end
+
+
 -- is baked clay mod active? add new flowers if so
 if minetest.get_modpath("bakedclay") then
 
diff --git a/water.lua b/water.lua
index 48eb525..476045c 100644
--- a/water.lua
+++ b/water.lua
@@ -101,6 +101,7 @@ minetest.register_abm({
 		end
 
 		nodeupdate(pos)
+		--minetest.check_for_falling(pos)
 	end,
 })
 
-- 
GitLab