2 if (minetest
.get_modpath("intllib")) then
3 dofile(minetest
.get_modpath("intllib").."/intllib.lua")
4 S
= intllib
.Getter(minetest
.get_current_modname())
6 S
= function ( s
) return s
end
11 bedrock
.layer
= -30912 -- determined as appropriate by experiment
12 bedrock
.node
= {name
= "bedrock2:bedrock"}
14 local depth
= tonumber(minetest
.setting_get("bedrock2_y"))
19 minetest
.register_on_generated(function(minp
, maxp
)
20 if maxp
.y
>= bedrock
.layer
and minp
.y
<= bedrock
.layer
then
21 local vm
, emin
, emax
= minetest
.get_mapgen_object("voxelmanip")
22 local data
= vm
:get_data()
23 local area
= VoxelArea
:new({MinEdge
=emin
, MaxEdge
=emax
})
24 local c_bedrock
= minetest
.get_content_id("bedrock2:bedrock")
26 for x
= minp
.x
, maxp
.x
do
27 for z
= minp
.z
, maxp
.z
do
28 local p_pos
= area
:index(x
, bedrock
.layer
, z
)
29 data
[p_pos
] = c_bedrock
40 minetest
.register_node("bedrock2:bedrock", {
41 description
= S("Bedrock"),
42 x_doc_items_longdesc
= S("Bedrock is a very hard block. It cannot be mined, altered, destroyed or moved by any means. It appears at the bottom of the world in a flat layer."),
43 tiles
= {"bedrock2_bedrock.png"},
44 groups
= {immortal
=1, not_in_creative_inventory
=1, in_doc
= 1 },
45 sounds
= { footstep
= { name
= "bedrock2_step", gain
= 1 } },
46 is_ground_content
= false,
47 on_blast
= function() end,
48 on_destruct
= function () end,
49 can_dig
= function() return false end,
54 if minetest
.get_modpath("mesecons_mvps") ~= nil then
55 mesecon
:register_mvps_stopper("bedrock2:bedrock")