1 local BEDROCK_LAYER
= -30912 -- determined as appropriate by experiment
3 local S
= minetest
.get_translator("bedrock")
5 minetest
.register_ore({
7 ore
= "bedrock:bedrock",
8 wherein
= "hades_core:stone",
9 clust_scarcity
= 1 * 1 * 1,
12 y_min
= BEDROCK_LAYER
, -- Engine changes can modify this value.
13 y_max
= -30656, -- This ensures the bottom of the world is not even loaded.
16 minetest
.register_ore({
18 ore
= "bedrock:deepstone",
19 wherein
= "hades_core:stone",
20 clust_scarcity
= 1 * 1 * 1,
27 minetest
.register_node("bedrock:bedrock", {
28 description
= S("Bedrock"),
29 tiles
= {"bedrock_bedrock.png"},
30 groups
= {unbreakable
= 1, not_in_creative_inventory
= 1}, -- For Map Tools' admin pickaxe.
31 sounds
= hades_sounds
.node_sound_stone_defaults(),
32 is_ground_content
= false,
33 on_blast
= function() end,
34 on_destruct
= function () end,
35 can_dig
= function() return false end,
40 minetest
.register_node("bedrock:deepstone", {
41 description
= S("Deepstone"),
42 tiles
= {"bedrock_deepstone.png"},
43 drop
= "hades_core:stone", -- Intended.
44 groups
= {cracky
= 1, level
= 3},
45 sounds
= hades_sounds
.node_sound_stone_defaults(),
48 -- Generate a perfect bedrock layer at the world bottom
49 minetest
.register_on_generated(function(minp
, maxp
)
50 if maxp
.y
>= BEDROCK_LAYER
and minp
.y
<= BEDROCK_LAYER
then
51 local vm
, emin
, emax
= minetest
.get_mapgen_object("voxelmanip")
52 local data
= vm
:get_data()
53 local area
= VoxelArea
:new({MinEdge
=emin
, MaxEdge
=emax
})
54 local c_bedrock
= minetest
.get_content_id("bedrock:bedrock")
56 for x
= minp
.x
, maxp
.x
do
57 for z
= minp
.z
, maxp
.z
do
58 local p_pos
= area
:index(x
, BEDROCK_LAYER
, z
)
59 data
[p_pos
] = c_bedrock
70 if minetest
.get_modpath("mesecons_mvps") then
71 mesecon
:register_mvps_stopper("bedrock:bedrock")
74 if minetest
.settings
:get_bool("log_mods") then
75 minetest
.log("action", "[bedrock] loaded.")