diff --git a/init.lua b/init.lua index 384e1d8..4d62b29 100644 --- a/init.lua +++ b/init.lua @@ -163,12 +163,13 @@ minetest.register_on_generated(function(minp, maxp, seed) --mandatory values local sidelen = x1 - x0 + 1 --length of a mapblock local chulens = {x=sidelen, y=sidelen, z=sidelen} --table of chunk edges + local chulens2D = {x=sidelen, y=sidelen, z=1} local minposxyz = {x=x0, y=y0, z=z0} --bottom corner local minposxz = {x=x0, y=z0} --2D bottom corner local nvals_cave = minetest.get_perlin_map(np_cave, chulens):get3dMap_flat(minposxyz) --cave noise for structure local nvals_wave = minetest.get_perlin_map(np_wave, chulens):get3dMap_flat(minposxyz) --wavy structure of cavern ceilings and floors - local nvals_biome = minetest.get_perlin_map(np_biome, chulens):get2dMap_flat({x=x0+150, y=z0+50}) --2D noise for biomes (will be 3D humidity/temp later) + local nvals_biome = minetest.get_perlin_map(np_biome, chulens2D):get2dMap_flat({x=x0+150, y=z0+50}) --2D noise for biomes (will be 3D humidity/temp later) local nixyz = 1 --3D node index local nixz = 1 --2D node index diff --git a/nodes.lua b/nodes.lua index a8db708..23f1051 100644 --- a/nodes.lua +++ b/nodes.lua @@ -4,6 +4,7 @@ local FALLING_ICICLES = caverealms.config.falling_icicles --true --toggle to turn on or off falling icicles in glaciated biome local FALLCHA = caverealms.config.fallcha --0.33 --chance of causing the structure to fall +local DM_TOP = caverealms.config.dm_top -- -4000 --level at which Dungeon Master Realms start to appear --glowing crystal @@ -537,6 +538,9 @@ minetest.register_node("caverealms:constant_flame", { after_dig_node = function(pos, oldnode, oldmetadata, digger) fire.on_flame_remove_at(pos) + if pos.y > DM_TOP then + minetest.remove_node(pos) + end end, }) @@ -546,6 +550,11 @@ minetest.register_node("caverealms:s_chest", { tiles = {"default_chest_front.png"}, paramtype2 = "facedir", groups = {choppy=3,oddly_breakable_by_hand=2,cavechest=1, not_in_creative_inventory=1}, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if pos.y > DM_TOP then + minetest.remove_node(pos) + end + end, }) --hacky schematic placers @@ -554,12 +563,22 @@ minetest.register_node("caverealms:s_fountain", { description = "A Hack like you should know what this does...", tiles = {"caverealms_stone_eyes.png"}, groups = {crumbly=3, schema=1, not_in_creative_inventory=1}, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if pos.y > DM_TOP then + minetest.remove_node(pos) + end + end, }) minetest.register_node("caverealms:s_fortress", { description = "A Hack like you should know what this does...", tiles = {"caverealms_stone_eyes.png"}, groups = {crumbly=3, schema=1, not_in_creative_inventory=1}, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if pos.y > DM_TOP then + minetest.remove_node(pos) + end + end, }) --dungeon master statue (nodebox)