diff --git a/README.md b/README.md index dbbe732..f1fc871 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,11 @@ several examples are at the documentation of [api.txt](api.txt) file. A huge thanks to Chinchow who was the inspiration behind Ethereal and everyone who helped make this mod bigger and better throughout it's release :) +### 1.32 + - Add {eatable} groups to food items + - Use underground decoration placement for illumishrooms to improve performance + - Use worldalign textures for stairs + ### 1.31 - Fix fishing biome checks - Increase bamboo leaf decay radius diff --git a/decor.lua b/decor.lua index 9563e49..7ef39cc 100644 --- a/decor.lua +++ b/decor.lua @@ -757,9 +757,21 @@ if minetest.registered_nodes["default:coral_green"] then end --- register async mapgen script -if minetest.register_mapgen_script then - minetest.register_mapgen_script(minetest.get_modpath("ethereal") .. "/decor_on_generated.lua") -else - dofile(minetest.get_modpath("ethereal") .. "/decor_on_generated.lua") +-- illumishrooms using underground decoration placement +local function add_illumishroom(low, high, nodename) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:stone_with_coal"}, + sidelen = 16, + fill_ratio = 0.5, + y_max = high, + y_min = low, + flags = "force_placement, all_floors", + decoration = nodename + }) end + +add_illumishroom(-1000, -30, "ethereal:illumishroom") +add_illumishroom(-2000, -1000, "ethereal:illumishroom2") +add_illumishroom(-3000, -2000, "ethereal:illumishroom3") diff --git a/decor_on_generated.lua b/decor_on_generated.lua deleted file mode 100644 index 455aa9e..0000000 --- a/decor_on_generated.lua +++ /dev/null @@ -1,39 +0,0 @@ - -local random = math.random - --- Generate Illumishroom in caves on top of coal -local function generate(minp, maxp) - - if minp.y > -30 or maxp.y < -3000 then - return - end - - local coal = minetest.find_nodes_in_area_under_air( - minp, maxp, "default:stone_with_coal") - - for n = 1, #coal do - - if random(2) == 1 then - - local bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z} - - if bpos.y > -3000 and bpos.y < -2000 then - minetest.set_node(bpos, {name = "ethereal:illumishroom3"}) - elseif bpos.y > -2000 and bpos.y < -1000 then - minetest.set_node(bpos, {name = "ethereal:illumishroom2"}) - elseif bpos.y > -1000 and bpos.y < -30 then - minetest.set_node(bpos, {name = "ethereal:illumishroom"}) - end - end - end -end - -if minetest.save_gen_notify then -- async env (5.9+) - minetest.register_on_generated(function(vmanip, minp, maxp, blockseed) - generate(minp, maxp) - end) -else -- main thread (5.8 and earlier) - minetest.register_on_generated(function(minp, maxp, blockseed) - generate(minp, maxp) - end) -end \ No newline at end of file