Generate deadly Void below the final bedrock layer

This commit is contained in:
Wuzzy 2017-02-20 06:24:04 +01:00
parent e0539a77f0
commit 0b375f00cd
2 changed files with 44 additions and 3 deletions

View File

@ -21,6 +21,44 @@ minetest.register_node("mcl_core:barrier", {
on_blast = function() end, on_blast = function() end,
}) })
-- The harmless void directly below the bottom bedrock layer. It doesn't hurt.
minetest.register_node("mcl_core:void_top", {
description = "Void",
drawtype = "airlike",
paramtype = "light",
pointable = false,
walkable = false,
floodable = false,
buildable_to = false,
inventory_image = "default_barrier.png",
wield_image = "default_barrier.png",
stack_max = 64,
sunlight_propagates = true,
is_ground_content = false,
groups = { not_in_creative_inventory = 1 },
on_blast = function() end,
})
-- The deadly void way below bedrock. It hurts very much!
minetest.register_node("mcl_core:void_deep", {
description = "Deep Void",
drawtype = "airlike",
paramtype = "light",
pointable = false,
walkable = false,
floodable = false,
buildable_to = false,
inventory_image = "default_barrier.png",
wield_image = "default_barrier.png",
stack_max = 64,
sunlight_propagates = true,
is_ground_content = false,
groups = { not_in_creative_inventory = 1 },
on_blast = function() end,
-- Minecraft Wiki: 4 damage each 0.5 seconds
damage_per_second = 8,
})
minetest.register_node("mcl_core:stone", { minetest.register_node("mcl_core:stone", {
description = "Stone", description = "Stone",
tiles = {"default_stone.png"}, tiles = {"default_stone.png"},

View File

@ -479,7 +479,8 @@ minetest.register_on_generated(function(minp, maxp)
local data = vm:get_data() local data = vm:get_data()
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax}) local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local c_bedrock = minetest.get_content_id("mcl_core:bedrock") local c_bedrock = minetest.get_content_id("mcl_core:bedrock")
--local c_void = minetest.get_content_id("mcl_core:void") local c_void_top = minetest.get_content_id("mcl_core:void_top")
local c_void_deep = minetest.get_content_id("mcl_core:void_deep")
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
for y = minp.y, math.min(maxp.y, BEDROCK_MAX) do for y = minp.y, math.min(maxp.y, BEDROCK_MAX) do
@ -502,8 +503,10 @@ minetest.register_on_generated(function(minp, maxp)
elseif y == BEDROCK_MAX -4 then elseif y == BEDROCK_MAX -4 then
-- 100% -- 100%
setdata = c_bedrock setdata = c_bedrock
elseif y < BEDROCK_MIN then elseif y < BEDROCK_MIN and y > BEDROCK_MIN - 64 then
setdata = c_air setdata = c_void_top
elseif y <= BEDROCK_MIN - 64 then
setdata = c_void_deep
end end
if setdata then if setdata then
data[p_pos] = setdata data[p_pos] = setdata