Skip to content

Commit

Permalink
Add fumaroles (Nether chimneys)
Browse files Browse the repository at this point in the history
Or they can be used on the surface as cottage chimneys.
  • Loading branch information
Treer committed Feb 18, 2020
1 parent c0f7608 commit d652144
Show file tree
Hide file tree
Showing 5 changed files with 452 additions and 12 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ 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` is a derivative work of gleamyRock.gif by Spring (https://opengameart.org/users/spring), used
under CC0 1.0. "Nether smoke puff" is licenced under CC BY-SA 4.0 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
226 changes: 214 additions & 12 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 @@ -143,19 +153,19 @@ minetest.register_decoration({
-- =======================================
-- 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
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_CEILING, -- keep compatibility with mapgen_nobiomes.lua
y_min = NETHER_FLOOR,
y_max = nether.DEPTH, -- keep compatibility with mapgen_nobiomes.lua
y_min = nether.DEPTH_FLOOR,
schematic = {
size = {x = 4, y = 7, z = 4},
data = {
data = { -- note that data is upside down
_, _, _, _,
_, _, _, _,
_, N, _, _,
Expand All @@ -165,7 +175,7 @@ if allow_lava_decorations then
_, _, _, _,

_, N, _, _, -- make it look like a stalactite if it protrudes out the bottom of a landform
_, N, _, _,
_, N, _, _,
N, L, N, _,
N, L, L, N,
N, L, L, N,
Expand Down Expand Up @@ -195,3 +205,195 @@ if allow_lava_decorations then
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

0 comments on commit d652144

Please sign in to comment.