Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fumaroles and lava sinkholes #14

Merged
merged 3 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ SOFTWARE.
* `nether_book_`* (files starting with "nether_book"): Treer, 2019-2020
* `nether_portal_ignition_failure.ogg`: Treer, 2019
* `nether_particle_anim`* (files starting with "nether_particle_anim"): Treer, 2019
* `nether_fumarole.ogg`: Treer, 2020
* `nether_smoke_puff.png`: Treer, 2020

### [Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)](http://creativecommons.org/licenses/by-sa/3.0/)
* `nether_rack.png`: Zeg9
Expand Down
275 changes: 268 additions & 7 deletions mapgen_decorations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,22 @@
-- emerged or not before the decoration was placed.
local allow_lava_decorations = nether.useBiomes

local _ = {name = "air", prob = 0}
local A = {name = "air", prob = 255, force_place = true}
local G = {name = "nether:glowstone", prob = 255, force_place = true}
local N = {name = "nether:rack", prob = 255}
local S = {name = "nether:sand", prob = 255, force_place = true}
local L = {name = "default:lava_source", prob = 255, force_place = true}
local _ = {name = "air", prob = 0}
local A = {name = "air", prob = 255, force_place = true}
local G = {name = "nether:glowstone", prob = 255, force_place = true}
local N = {name = "nether:rack", prob = 255}
local S = {name = "nether:sand", prob = 255, force_place = true}
local L = {name = "default:lava_source", prob = 255, force_place = true}
local F = {name = "nether:fumarole", prob = 255, force_place = true}
local FS = {name = "nether:fumarole_slab", prob = 255, force_place = true}
local F1 = {name = "nether:fumarole_corner", prob = 255, force_place = true, param2 = 0}
local F2 = {name = "nether:fumarole_corner", prob = 255, force_place = true, param2 = 1}
local F3 = {name = "nether:fumarole_corner", prob = 255, force_place = true, param2 = 2}
local F4 = {name = "nether:fumarole_corner", prob = 255, force_place = true, param2 = 3}
local S1 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 5}
local S2 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 7}
local S3 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 12}
local S4 = {name = "stairs:stair_netherrack", prob = 255, force_place = true, param2 = 16}


-- =================
Expand All @@ -39,7 +49,7 @@ local L = {name = "default:lava_source", prob = 255, force_place = true}

local schematic_GlowstoneStalactite = {
size = {x = 5, y = 10, z = 5},
data = {
data = { -- note that data is upside down
_, _, _, _, _,
_, _, _, _, _,
_, _, _, _, _,
Expand Down Expand Up @@ -136,3 +146,254 @@ minetest.register_decoration({
flags = "place_center_x,place_center_z,all_ceilings",
place_offset_y=-3
})


-- =======================================
-- Concealed crevice / Lava sinkhole
-- =======================================
-- if player places a torch/block on this sand or digs it while standing on it, it sinks into lava

if allow_lava_decorations then
minetest.register_decoration({
name = "Weak trap",
deco_type = "schematic",
place_on = "nether:rack",
sidelen = 80,
fill_ratio = 0.002,
biomes = {"nether_caverns"},
y_max = nether.DEPTH, -- keep compatibility with mapgen_nobiomes.lua
y_min = nether.DEPTH_FLOOR,
schematic = {
size = {x = 4, y = 7, z = 4},
data = { -- note that data is upside down
_, _, _, _,
_, _, _, _,
_, N, _, _,
_, N, N, _,
_, N, N, _,
_, N, N, _,
_, _, _, _,

_, N, _, _, -- make it look like a stalactite if it protrudes out the bottom of a landform
_, N, _, _,
N, L, N, _,
N, L, L, N,
N, L, L, N,
N, A, A, N,
_, S, S, _,

_, _, _, _,
_, _, _, _,
_, N, N, _,
N, L, L, N,
N, L, L, N,
N, A, A, N,
_, S, S, _,

_, _, _, _,
_, _, _, _,
_, _, _, _,
_, N, N, _,
_, N, N, _,
_, N, N, _,
_, _, _, _,
}
},
replacements = {["nether:glowstone"] = "nether:rack"},
flags = "place_center_x,place_center_z,force_placement, all_floors",
place_offset_y=-6,
rotation = "random"
})
end


-- ==========================
-- Fumaroles (Chimneys)
-- ==========================


local replacements_slab = {}
local replacements_full = {["nether:fumarole_slab"] = "nether:fumarole"}

if allow_lava_decorations then
-- Minetest engine limitations mean any mesh or nodebox node (like nether:fumarole)
-- will light up if it has lava below it, so replace the air node over the lava with
-- a node that prevents light propagation.
-- (Unfortunately this also means if a player digs down to get the lava block it'll
-- look like the lighting wasn't set in the block above the lava)
replacements_slab["air"] = "nether:airlike_darkness"
replacements_full["air"] = "nether:airlike_darkness"
else
-- Lava is frequently removed by the old mapgen, so put sand at the bottom
-- of fumaroles.
replacements_slab["default:lava_source"] = "nether:sand"
replacements_full["default:lava_source"] = "nether:sand"
end


local schematic_fumarole = {
size = {x = 3, y = 5, z = 3},
data = { -- note that data is upside down
_, _, _,
_, N, _,
_, N, _,
_, _, _,
_, _, _,

_, N, _,
N, L, N,
N, A, N,
_, F, _,
_,FS, _,

_, _, _,
_, N, _,
_, N, _,
_, _, _,
_, _, _,
},
}

-- Common fumarole decoration that's flush with the floor and spawns everywhere

minetest.register_decoration({
name = "Sunken nether fumarole",
deco_type = "schematic",
place_on = {"nether:rack"},
sidelen = 80,
fill_ratio = 0.005,
biomes = {"nether_caverns"},
y_max = nether.DEPTH,
y_min = nether.DEPTH_FLOOR,
schematic = schematic_fumarole,
replacements = replacements_full,
flags = "place_center_x,place_center_z,all_floors",
place_offset_y=-4
})


-- Rarer formations of raised fumaroles in clumps

local fumarole_clump_noise_offset = -0.58
local fumarole_clump_noise = {
offset = fumarole_clump_noise_offset,
scale = 0.5,
spread = {x = 40, y = 40, z = 15},
octaves = 4,
persist = 0.65,
lacunarity = 2.0,
}

fumarole_clump_noise.offset = fumarole_clump_noise_offset - 0.035
minetest.register_decoration({
name = "Raised Nether fumarole",
deco_type = "schematic",
place_on = {"nether:rack"},
sidelen = 8,
noise_params = fumarole_clump_noise,
biomes = {"nether_caverns"},
y_max = nether.DEPTH,
y_min = nether.DEPTH_FLOOR,
schematic = schematic_fumarole,
replacements = replacements_full,
flags = "place_center_x,place_center_z,all_floors",
place_offset_y=-3
})

fumarole_clump_noise.offset = fumarole_clump_noise_offset
minetest.register_decoration({
name = "Half-raised Nether fumarole",
deco_type = "schematic",
place_on = {"nether:rack"},
sidelen = 8,
noise_params = fumarole_clump_noise,
biomes = {"nether_caverns"},
y_max = nether.DEPTH,
y_min = nether.DEPTH_FLOOR,
schematic = schematic_fumarole,
replacements = replacements_slab,
flags = "place_center_x,place_center_z,all_floors",
place_offset_y=-3
})

fumarole_clump_noise.offset = fumarole_clump_noise_offset - 0.035
minetest.register_decoration({
name = "Nether fumarole mound",
deco_type = "schematic",
place_on = {"nether:rack"},
sidelen = 8,
noise_params = fumarole_clump_noise,
biomes = {"nether_caverns"},
y_max = nether.DEPTH,
y_min = nether.DEPTH_FLOOR,
schematic = {
size = {x = 4, y = 4, z = 4},
data = { -- note that data is upside down
_, _, _, _,
_, N, N, _,
_, _, _, _,
_, _, _, _,

_, S, S, _,
N, A, A, N,
_, S2, S1, _,
_, F2, F1, _,

_, S, S, _,
N, A, A, N,
_, S3, S4, _,
_, F3, F4, _,

_, _, _, _,
_, N, N, _,
_, _, _, _,
_, _, _, _
},
yslice_prob = {{ypos = 3, prob = 192}} -- occasionally leave the fumarole cap off
},
flags = "place_center_x,place_center_z,all_floors",
place_offset_y = -2
})

fumarole_clump_noise.offset = fumarole_clump_noise_offset - 0.01
minetest.register_decoration({
name = "Double Nether fumarole",
deco_type = "schematic",
place_on = {"nether:rack"},
sidelen = 8,
noise_params = fumarole_clump_noise,
biomes = {"nether_caverns"},
y_max = nether.DEPTH,
y_min = nether.DEPTH_FLOOR,
schematic = {
size = {x = 4, y = 5, z = 4},
data = { -- note that data is upside down
_, _, _, _,
_, N, N, _,
_, _, _, _,
_, _, _, _,
_, _, _, _,

_, S, S, _,
N, A, A, N,
_, S2, S1, _,
_, F2, F, _,
_, _, FS, _,

_, S, S, _,
F, A, A, N, -- the F may add slight variance in landforms where it gets exposed
_, S3, S4, _,
_, F3, F4, _,
_, _, _, _,

_, _, _, _,
_, N, N, _,
_, _, _, _,
_, _, _, _,
_, _, _, _
}
},
flags = "place_center_x,place_center_z,all_floors",
place_offset_y = -2,
rotation = "random"
})
Loading