Activate waving=1 for more plants
[minetest_hades/hades_revisited.git] / mods / bedrock / init.lua
blobf552b2c852d30cdc4f94d0f1f040de814a9512c7
1 local BEDROCK_LAYER = -30912 -- determined as appropriate by experiment
3 local S = minetest.get_translator("bedrock")
5 minetest.register_ore({
6 ore_type = "scatter",
7 ore = "bedrock:bedrock",
8 wherein = "hades_core:stone",
9 clust_scarcity = 1 * 1 * 1,
10 clust_num_ores = 5,
11 clust_size = 2,
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({
17 ore_type = "scatter",
18 ore = "bedrock:deepstone",
19 wherein = "hades_core:stone",
20 clust_scarcity = 1 * 1 * 1,
21 clust_num_ores = 5,
22 clust_size = 2,
23 y_min = -30656,
24 y_max = -30000,
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,
36 diggable = false,
37 drop = "",
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
60 end
61 end
63 vm:set_data(data)
64 vm:calc_lighting()
65 vm:update_liquids()
66 vm:write_to_map()
67 end
68 end)
70 if minetest.get_modpath("mesecons_mvps") then
71 mesecon:register_mvps_stopper("bedrock:bedrock")
72 end
74 if minetest.settings:get_bool("log_mods") then
75 minetest.log("action", "[bedrock] loaded.")
76 end