Stability Update, Further Grief Prevention

Made a tweak to the noise that both speeds up mapgen and prevents
crashes with Minetest 0.4.11.  Also made it so that DM realm structure
spawners automatically remove themselves from the surface world,
preventing griefing.
master
Chris N 2015-01-06 11:57:15 -10:00
parent 01c65f72e0
commit 2600ce6a37
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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)