1
0
Fork 0

MGV6: Generate witch huts only in Normal biome

objects
Wuzzy 2019-09-11 16:06:41 +02:00
parent a8a875a7b4
commit 76ed6ff826
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,6 @@
mcl_init mcl_init
mcl_core mcl_core
biomeinfo
mclx_core? mclx_core?
mcl_worlds mcl_worlds
mcl_cocoas mcl_cocoas

View File

@ -1170,7 +1170,8 @@ local function generate_structures(minp, maxp, seed, biomemap)
-- Witch hut -- Witch hut
if ground_y <= 0 and nn == "mcl_core:dirt" then if ground_y <= 0 and nn == "mcl_core:dirt" then
local prob = minecraft_chunk_probability(48, minp, maxp) local prob = minecraft_chunk_probability(48, minp, maxp)
if math.random(1, prob) == 1 then
local swampland = minetest.get_biome_id("Swampland") local swampland = minetest.get_biome_id("Swampland")
local swampland_shore = minetest.get_biome_id("Swampland_shore") local swampland_shore = minetest.get_biome_id("Swampland_shore")
@ -1179,19 +1180,19 @@ local function generate_structures(minp, maxp, seed, biomemap)
local here_be_witches = false local here_be_witches = false
if mg_name == "v6" then if mg_name == "v6" then
-- In ye good ol' landes of v6, witches will settle at any -- v6: In Normal biome
-- shores of dirt. if biomeinfo.get_v6_biome(p) == "Normal" then
here_be_witches = true here_be_witches = true
end
else else
-- The townsfolk told me that witches live in the swamplands! -- Other mapgens: In swampland biome
local bi = xz_to_biomemap_index(p.x, p.z, minp, maxp) local bi = xz_to_biomemap_index(p.x, p.z, minp, maxp)
if biomemap[bi] == swampland or biomemap[bi] == swampland_shore then if biomemap[bi] == swampland or biomemap[bi] == swampland_shore then
here_be_witches = true here_be_witches = true
end end
end end
-- We still need a bit of luck! if here_be_witches then
if here_be_witches and math.random(1, prob) == 1 then
local r = tostring(math.random(0, 3) * 90) -- "0", "90", "180" or 270" local r = tostring(math.random(0, 3) * 90) -- "0", "90", "180" or 270"
local p1 = {x=p.x-1, y=WITCH_HUT_HEIGHT+2, z=p.z-1} local p1 = {x=p.x-1, y=WITCH_HUT_HEIGHT+2, z=p.z-1}
local size local size
@ -1268,6 +1269,7 @@ local function generate_structures(minp, maxp, seed, biomemap)
end end
end end
end end
end
-- Ice spikes in v6 -- Ice spikes in v6
-- In other mapgens, ice spikes are generated as decorations. -- In other mapgens, ice spikes are generated as decorations.