Merge pull request 'Add Biome Coloured Foliage' (#3420) from biome_colored_foliage into master

Reviewed-on: MineClone2/MineClone2#3420
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
ancientmarinerdev 2023-02-16 22:35:05 +00:00
commit db7f4699eb
19 changed files with 283 additions and 66 deletions

View File

@ -1016,3 +1016,19 @@ function mcl_util.check_position_protection(position, player)
return false
end
local palette_indexes = {grass_palette_index = 0, foliage_palette_index = 0}
function mcl_util.get_palette_indexes_from_pos(pos)
local biome_data = minetest.get_biome_data(pos)
local biome = biome_data.biome
local biome_name = minetest.get_biome_name(biome)
local reg_biome = minetest.registered_biomes[biome_name]
if reg_biome and reg_biome._mcl_grass_palette_index and reg_biome._mcl_foliage_palette_index then
local gpi = reg_biome._mcl_grass_palette_index
local fpi = reg_biome._mcl_foliage_palette_index
local palette_indexes = {grass_palette_index = gpi, foliage_palette_index = fpi}
return palette_indexes
else
return palette_indexes
end
end

View File

@ -405,6 +405,7 @@ function mcl_core.generate_tree(pos, tree_type, options)
elseif tree_type == BIRCH_TREE_ID then
mcl_core.generate_birch_tree(pos)
end
mcl_core.update_sapling_foliage_colors(pos)
end
-- Classic oak in v6 style
@ -801,23 +802,14 @@ end
local grass_spread_randomizer = PseudoRandom(minetest.get_mapgen_setting("seed"))
function mcl_core.get_grass_palette_index(pos)
local biome_data = minetest.get_biome_data(pos)
local index = 0
if biome_data then
local biome = biome_data.biome
local biome_name = minetest.get_biome_name(biome)
local reg_biome = minetest.registered_biomes[biome_name]
if reg_biome then
index = reg_biome._mcl_grass_palette_index
end
end
return index
end
-- Return appropriate grass block node for pos
function mcl_core.get_grass_block_type(pos)
return {name = "mcl_core:dirt_with_grass", param2 = mcl_core.get_grass_palette_index(pos)}
return {name = minetest.get_node(pos).name, param2 = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index}
end
-- Return appropriate foliage block node for pos
function mcl_core.get_foliage_block_type(pos)
return {name = minetest.get_node(pos).name, param2 = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index}
end
------------------------------
@ -1073,6 +1065,16 @@ local grow_acacia = sapling_grow_action(ACACIA_TREE_ID, 2, true, false)
local grow_spruce = sapling_grow_action(SPRUCE_TREE_ID, 1, true, true, "mcl_core:sprucesapling")
local grow_birch = sapling_grow_action(BIRCH_TREE_ID, 1, true, false)
function mcl_core.update_sapling_foliage_colors(pos)
local pos1, pos2 = vector.offset(pos, -8, 0, -8), vector.offset(pos, 8, 30, 8)
local fnode
local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"})
for _, fpos in pairs(foliage) do
fnode = minetest.get_node(fpos)
minetest.set_node(fpos, fnode)
end
end
-- Attempts to grow the sapling at the specified position
-- pos: Position
-- node: Node table of the node at this position, from minetest.get_node

View File

@ -127,7 +127,7 @@ minetest.register_node("mcl_core:reeds", {
on_construct = function(pos)
local node = minetest.get_node(pos)
if node.param2 == 0 then
node.param2 = mcl_core.get_grass_palette_index(pos)
node.param2 = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
if node.param2 ~= 0 then
minetest.set_node(pos, node)
end

View File

@ -92,11 +92,13 @@ minetest.register_node("mcl_core:vine", {
_doc_items_longdesc = S("Vines are climbable blocks which can be placed on the sides of solid full-cube blocks. Vines slowly grow and spread."),
drawtype = "signlike",
tiles = {"mcl_core_vine.png"},
color = "#48B518",
inventory_image = "mcl_core_vine.png",
wield_image = "mcl_core_vine.png",
paramtype = "light",
sunlight_propagates = true,
paramtype2 = "wallmounted",
paramtype2 = "colorwallmounted",
palette = "[combine:16x2:0,0=mcl_core_palette_foliage.png",
walkable = false,
climbable = true,
buildable_to = true,
@ -107,7 +109,7 @@ minetest.register_node("mcl_core:vine", {
groups = {
handy = 1, axey = 1, shearsy = 1, swordy = 1, deco_block = 1,
dig_by_piston = 1, destroy_by_lava_flow = 1, compostability = 50,
flammable = 2, fire_encouragement = 15, fire_flammability = 100
flammable = 2, fire_encouragement = 15, fire_flammability = 100, foliage_palette_wallmounted = 1
},
sounds = mcl_sounds.node_sound_leaves_defaults(),
drop = "",
@ -155,6 +157,20 @@ minetest.register_node("mcl_core:vine", {
return itemstack
end,
on_construct = function(pos)
local node = minetest.get_node(pos)
local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index
if node.name == "mcl_core:vine" then
local biome_param2 = foliage_palette_index
local rotation_param2 = node.param2
local final_param2 = (biome_param2 * 8) + rotation_param2
if node.param2 ~= final_param2 and rotation_param2 < 6 then
node.param2 = final_param2
minetest.swap_node(pos, node)
end
end
end,
-- If dug, also dig a “dependant” vine below it.
-- A vine is dependant if it hangs from this node and has no supporting block.
on_dig = function(pos, node, digger)

View File

@ -15,11 +15,10 @@ end
--
-- Whenever a trunk node is removed, all `group:leaves` nodes in a sphere
-- with radius 6 are checked. Every such node that does not have a trunk
-- node within a distance of 6 blocks is converted into a orphan leaf node.
-- node within a distance of 6 blocks and wasn't placed by a player is
-- converted into a orphan leaf node.
-- An ABM will gradually decay these nodes.
--
-- If param2 of the node is set to a nonzero value, the node will always
-- be preserved. This is set automatically when leaves are placed manually.
--
-- @param pos the position of the removed trunk node.
-- @param oldnode the node table of the removed trunk node.
@ -29,26 +28,28 @@ function mcl_core.update_leaves(pos, oldnode)
local leaves = minetest.find_nodes_in_area(pos1, pos2, "group:leaves")
for _, lpos in pairs(leaves) do
lnode = minetest.get_node(lpos)
-- skip already decaying leaf nodes
if minetest.get_item_group(lnode.name, "orphan_leaves") ~= 1 then
lmeta = minetest.get_meta(lpos)
-- skip already decaying leaf nodes and player leaves
if minetest.get_item_group(lnode.name, "orphan_leaves") ~= 1 and lmeta:get_int("player_leaves") ~= 1 then
if not minetest.find_node_near(lpos, 6, "group:tree") then
-- manually placed leaf nodes have param2
-- set and will never decay automatically
if lnode.param2 == 0 then
local orphan_name = lnode.name .. "_orphan"
local def = minetest.registered_nodes[orphan_name]
if def then
--minetest.log("Registered: ".. orphan_name)
minetest.swap_node(lpos, {name = orphan_name})
else
--minetest.log("Not registered: ".. orphan_name)
end
local orphan_name = lnode.name .. "_orphan"
local def = minetest.registered_nodes[orphan_name]
if def then
--minetest.log("Registered: ".. orphan_name)
minetest.set_node(lpos, {name = orphan_name})
else
--minetest.log("Not registered: ".. orphan_name)
end
end
end
end
end
function mcl_core.make_player_leaves(pos)
local meta = minetest.get_meta(pos)
meta:set_int("player_leaves", 1)
end
-- Register tree trunk (wood) and bark
local function register_tree_trunk(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_variant)
minetest.register_node("mcl_core:"..subname, {
@ -149,7 +150,7 @@ local function register_wooden_planks(subname, description, tiles)
})
end
local function register_leaves(subname, description, longdesc, tiles, sapling, drop_apples, sapling_chances)
local function register_leaves(subname, description, longdesc, tiles, color, paramtype2, sapling, drop_apples, sapling_chances, foliage_palette)
local apple_chances = {200, 180, 160, 120, 40}
local stick_chances = {50, 45, 30, 35, 10}
@ -186,14 +187,16 @@ local function register_leaves(subname, description, longdesc, tiles, sapling, d
_doc_items_hidden = false,
drawtype = "allfaces_optional",
waving = 2,
place_param2 = 1, -- Prevent leafdecay for placed nodes
tiles = tiles,
color = color,
paramtype = "light",
paramtype2 = paramtype2,
palette = "mcl_core_palette_foliage.png",
stack_max = 64,
groups = {
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
leaves = 1, deco_block = 1, compostability = 30
leaves = 1, deco_block = 1, compostability = 30, foliage_palette = foliage_palette
},
drop = get_drops(0),
_mcl_shears_drop = true,
@ -202,13 +205,24 @@ local function register_leaves(subname, description, longdesc, tiles, sapling, d
_mcl_hardness = 0.2,
_mcl_silk_touch_drop = true,
_mcl_fortune_drop = { get_drops(1), get_drops(2), get_drops(3), get_drops(4) },
}
on_construct = function(pos)
local node = minetest.get_node(pos)
if node.param2 == 0 then
local new_node = mcl_core.get_foliage_block_type(pos)
if new_node.param2 ~= 0 then
minetest.swap_node(pos, new_node)
end
end
end,
after_place_node = function(pos)
mcl_core.make_player_leaves(pos) -- Leaves placed by the player should always be player leaves.
end,
}
minetest.register_node("mcl_core:" .. subname, l_def)
local o_def = table.copy(l_def)
o_def._doc_items_create_entry = false
o_def.place_param2 = nil
o_def.groups.not_in_creative_inventory = 1
o_def.groups.orphan_leaves = 1
o_def._mcl_shears_drop = {"mcl_core:" .. subname}
@ -310,12 +324,12 @@ register_sapling("birchsapling", S("Birch Sapling"),
"mcl_core_sapling_birch.png", {-4/16, -0.5, -4/16, 4/16, 0.5, 4/16})
register_leaves("leaves", S("Oak Leaves"), S("Oak leaves are grown from oak trees."), {"default_leaves.png"}, "mcl_core:sapling", true, {20, 16, 12, 10})
register_leaves("darkleaves", S("Dark Oak Leaves"), S("Dark oak leaves are grown from dark oak trees."), {"mcl_core_leaves_big_oak.png"}, "mcl_core:darksapling", true, {20, 16, 12, 10})
register_leaves("jungleleaves", S("Jungle Leaves"), S("Jungle leaves are grown from jungle trees."), {"default_jungleleaves.png"}, "mcl_core:junglesapling", false, {40, 26, 32, 24, 10})
register_leaves("acacialeaves", S("Acacia Leaves"), S("Acacia leaves are grown from acacia trees."), {"default_acacia_leaves.png"}, "mcl_core:acaciasapling", false, {20, 16, 12, 10})
register_leaves("spruceleaves", S("Spruce Leaves"), S("Spruce leaves are grown from spruce trees."), {"mcl_core_leaves_spruce.png"}, "mcl_core:sprucesapling", false, {20, 16, 12, 10})
register_leaves("birchleaves", S("Birch Leaves"), S("Birch leaves are grown from birch trees."), {"mcl_core_leaves_birch.png"}, "mcl_core:birchsapling", false, {20, 16, 12, 10})
register_leaves("leaves", S("Oak Leaves"), S("Oak leaves are grown from oak trees."), {"default_leaves.png"}, "#48B518", "color", "mcl_core:sapling", true, {20, 16, 12, 10}, 1)
register_leaves("darkleaves", S("Dark Oak Leaves"), S("Dark oak leaves are grown from dark oak trees."), {"mcl_core_leaves_big_oak.png"}, "#48B518", "color", "mcl_core:darksapling", true, {20, 16, 12, 10}, 1)
register_leaves("jungleleaves", S("Jungle Leaves"), S("Jungle leaves are grown from jungle trees."), {"default_jungleleaves.png"}, "#48B518", "color", "mcl_core:junglesapling", false, {40, 26, 32, 24, 10}, 1)
register_leaves("acacialeaves", S("Acacia Leaves"), S("Acacia leaves are grown from acacia trees."), {"default_acacia_leaves.png"}, "#48B518", "color", "mcl_core:acaciasapling", false, {20, 16, 12, 10}, 1)
register_leaves("spruceleaves", S("Spruce Leaves"), S("Spruce leaves are grown from spruce trees."), {"mcl_core_leaves_spruce.png"}, "#619961", "none", "mcl_core:sprucesapling", false, {20, 16, 12, 10}, 0)
register_leaves("birchleaves", S("Birch Leaves"), S("Birch leaves are grown from birch trees."), {"mcl_core_leaves_birch.png"}, "#80A755", "none", "mcl_core:birchsapling", false, {20, 16, 12, 10}, 0)

View File

@ -427,6 +427,7 @@ minetest.register_node("mcl_flowers:waterlily", {
paramtype = "light",
paramtype2 = "facedir",
tiles = {"flowers_waterlily.png", "flowers_waterlily.png^[transformFY"},
color = "#208030",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
inventory_image = "flowers_waterlily.png",
wield_image = "flowers_waterlily.png",

View File

@ -92,13 +92,15 @@ local l_def = {
_doc_items_hidden = false,
drawtype = "allfaces_optional",
waving = 2,
place_param2 = 1, -- Prevent leafdecay for placed nodes
tiles = {"mcl_mangrove_leaves.png"},
color = "#48B518",
paramtype = "light",
paramtype2 = "color",
palette = "mcl_core_palette_foliage.png",
groups = {
handy = 1, hoey = 1, shearsy = 1, swordy = 1, dig_by_piston = 1,
flammable = 2, fire_encouragement = 30, fire_flammability = 60,
leaves = 1, deco_block = 1, compostability = 30
leaves = 1, deco_block = 1, compostability = 30, foliage_palette = 1
},
drop = get_drops(0),
_mcl_shears_drop = true,
@ -107,13 +109,24 @@ local l_def = {
_mcl_hardness = 0.2,
_mcl_silk_touch_drop = true,
_mcl_fortune_drop = { get_drops(1), get_drops(2), get_drops(3), get_drops(4) },
on_construct = function(pos)
local node = minetest.get_node(pos)
if node.param2 == 0 or node.param2 == 1 then -- Check if param2 is 1 as well, since the schematics accidentally have the param2 of mangrove leaves be 1.
local new_node = mcl_core.get_foliage_block_type(pos)
if new_node.param2 ~= 0 then
minetest.swap_node(pos, new_node)
end
end
end,
after_place_node = function(pos)
mcl_core.make_player_leaves(pos) -- Leaves placed by the player should always be player leaves.
end,
}
minetest.register_node("mcl_mangrove:mangroveleaves", l_def)
local o_def = table.copy(l_def)
o_def._doc_items_create_entry = false
o_def.place_param2 = nil
o_def.groups.not_in_creative_inventory = 1
o_def.groups.orphan_leaves = 1
o_def._mcl_shears_drop = {"mcl_mangrove:mangroveleaves"}
@ -549,8 +562,9 @@ minetest.register_abm({
local nn = minetest.find_nodes_in_area(vector.offset(pos,0,-1,0),vector.offset(pos,0,h,0),{"group:water","air"})
if #nn >= h then
minetest.place_schematic(pos, path, "random", function()
local nnv = minetest.find_nodes_in_area(vector.offset(pos,-5,-1,-5),vector.offset(pos,5,h/2,5),{"mcl_core:vine"})
minetest.bulk_set_node(nnv,{"air"})
mcl_core.update_sapling_foliage_colors(pos)
local nnv = minetest.find_nodes_in_area(vector.offset(pos,-5,-1,-5),vector.offset(pos,5,h/2,5),{"mcl_core:vine"})
minetest.bulk_set_node(nnv,{"air"})
end, true, "place_center_x, place_center_z")
end
return
@ -558,6 +572,7 @@ minetest.register_abm({
if r > 3 then h = 18 end
if mcl_core.check_growth_width(pos,w,h) then
minetest.place_schematic(pos, path, "random", nil, true, "place_center_x, place_center_z")
mcl_core.update_sapling_foliage_colors(pos)
end
end
end,
})

View File

@ -51,6 +51,7 @@ local function register_classic_superflat_biome()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -161,6 +162,7 @@ local function register_biomes()
heat_point = -5,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 2,
_mcl_foliage_palette_index = 2,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -179,6 +181,7 @@ local function register_biomes()
heat_point = -5,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 2,
_mcl_foliage_palette_index = 2,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -199,6 +202,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 3,
_mcl_foliage_palette_index = 2,
_mcl_skycolor = "#839EFF",
_mcl_fogcolor = overworld_fogcolor
})
@ -221,6 +225,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 3,
_mcl_foliage_palette_index = 16,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -241,6 +246,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 3,
_mcl_foliage_palette_index = 16,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -259,6 +265,7 @@ local function register_biomes()
vertical_blend = 1,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 3,
_mcl_foliage_palette_index = 2,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -278,6 +285,7 @@ local function register_biomes()
heat_point = 10,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 4,
_mcl_foliage_palette_index = 9,
_mcl_skycolor = "#7CA3FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -295,6 +303,7 @@ local function register_biomes()
heat_point = 10,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 4,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -314,6 +323,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 5,
_mcl_foliage_palette_index = 10,
_mcl_skycolor = "#7DA3FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -331,6 +341,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 5,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -351,6 +362,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 6,
_mcl_foliage_palette_index = 11,
_mcl_skycolor = "#7DA2FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -369,6 +381,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 6,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = beach_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -387,6 +400,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 6,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -407,6 +421,7 @@ local function register_biomes()
heat_point = 25,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 7,
_mcl_foliage_palette_index = 11,
_mcl_skycolor = "#7DA2FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -424,6 +439,7 @@ local function register_biomes()
heat_point = 25,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 7,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -446,6 +462,7 @@ local function register_biomes()
vertical_blend = 6,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 8,
_mcl_foliage_palette_index = 11,
_mcl_skycolor = "#7DA2FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -466,6 +483,7 @@ local function register_biomes()
heat_point = 25,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 8,
_mcl_foliage_palette_index = 11,
_mcl_skycolor = "#7DA2FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -483,6 +501,7 @@ local function register_biomes()
heat_point = 25,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 8,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -500,6 +519,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 9,
_mcl_foliage_palette_index = 11,
_mcl_skycolor = "#7DA2FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -517,6 +537,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 9,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -540,6 +561,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 10,
_mcl_foliage_palette_index = 2,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -557,6 +579,7 @@ local function register_biomes()
heat_point = 8,
_mcl_biome_type = "snowy",
_mcl_grass_palette_index = 10,
_mcl_foliage_palette_index = 2,
_mcl_skycolor = "#7FA1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -576,6 +599,7 @@ local function register_biomes()
heat_point = 58,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -593,6 +617,7 @@ local function register_biomes()
heat_point = 58,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = beach_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -610,6 +635,7 @@ local function register_biomes()
heat_point = 58,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -629,6 +655,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 11,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -646,6 +673,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 11,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -665,6 +693,7 @@ local function register_biomes()
heat_point = 22,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 12,
_mcl_foliage_palette_index = 10,
_mcl_skycolor = "#7DA3FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -682,6 +711,7 @@ local function register_biomes()
heat_point = 22,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 12,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = beach_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -699,6 +729,7 @@ local function register_biomes()
heat_point = 22,
_mcl_biome_type = "cold",
_mcl_grass_palette_index = 12,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -718,6 +749,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 13,
_mcl_foliage_palette_index = 7,
_mcl_skycolor = "#79A6FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -735,6 +767,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 13,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = beach_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -752,6 +785,7 @@ local function register_biomes()
heat_point = 45,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 13,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -771,6 +805,7 @@ local function register_biomes()
heat_point = 32,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 14,
_mcl_foliage_palette_index = 7,
_mcl_skycolor = "#79A6FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -788,6 +823,7 @@ local function register_biomes()
heat_point = 32,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 14,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = beach_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -805,6 +841,7 @@ local function register_biomes()
heat_point = 32,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 14,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -824,6 +861,7 @@ local function register_biomes()
heat_point = 31,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 15,
_mcl_foliage_palette_index = 8,
_mcl_skycolor = "#7AA5FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -841,6 +879,7 @@ local function register_biomes()
heat_point = 31,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 15,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -860,6 +899,7 @@ local function register_biomes()
heat_point = 27,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 16,
_mcl_foliage_palette_index = 8,
_mcl_skycolor = "#7AA5FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -877,6 +917,7 @@ local function register_biomes()
heat_point = 27,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 16,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -897,6 +938,7 @@ local function register_biomes()
heat_point = 94,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -914,6 +956,7 @@ local function register_biomes()
heat_point = 94,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -933,6 +976,7 @@ local function register_biomes()
heat_point = 27,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 18,
_mcl_foliage_palette_index = 7,
_mcl_skycolor = "#79A6FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -950,6 +994,7 @@ local function register_biomes()
heat_point = 27,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 18,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -970,6 +1015,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 19,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -989,6 +1035,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 19,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1007,6 +1054,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 19,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1026,6 +1074,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 20,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1044,6 +1093,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 20,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1062,6 +1112,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 20,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1083,6 +1134,7 @@ local function register_biomes()
vertical_blend = 0, -- we want a sharp transition
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 21,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1104,6 +1156,7 @@ local function register_biomes()
heat_point = 60,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 21,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1122,6 +1175,7 @@ local function register_biomes()
heat_point = 60,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 21,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1140,6 +1194,7 @@ local function register_biomes()
heat_point = 60,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 21,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1163,6 +1218,7 @@ local function register_biomes()
vertical_blend = 5,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 22,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1182,6 +1238,7 @@ local function register_biomes()
heat_point = 60,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 22,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1202,6 +1259,7 @@ local function register_biomes()
vertical_blend = 4,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 22,
_mcl_foliage_palette_index = 4,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1220,6 +1278,7 @@ local function register_biomes()
heat_point = 60,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 22,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1240,6 +1299,7 @@ local function register_biomes()
heat_point = 79,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 1,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1257,6 +1317,7 @@ local function register_biomes()
heat_point = 79,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 1,
_mcl_foliage_palette_index = 1,
_mcl_skycolor = beach_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1274,6 +1335,7 @@ local function register_biomes()
heat_point = 79,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 1,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1295,6 +1357,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 23,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = "#6EB1FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1312,6 +1375,7 @@ local function register_biomes()
heat_point = 100,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 23,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1331,6 +1395,7 @@ local function register_biomes()
heat_point = 81,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 24,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1348,6 +1413,7 @@ local function register_biomes()
heat_point = 81,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 24,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1366,6 +1432,7 @@ local function register_biomes()
heat_point = 81,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 24,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1386,6 +1453,7 @@ local function register_biomes()
heat_point = 81,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 25,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1403,6 +1471,7 @@ local function register_biomes()
heat_point = 81,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 25,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1421,6 +1490,7 @@ local function register_biomes()
heat_point = 81,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 25,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1440,6 +1510,7 @@ local function register_biomes()
heat_point = 76,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 26,
_mcl_foliage_palette_index = 13,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1457,6 +1528,7 @@ local function register_biomes()
heat_point = 76,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 26,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1479,6 +1551,7 @@ local function register_biomes()
heat_point = 79,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 13,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1496,6 +1569,7 @@ local function register_biomes()
heat_point = 79,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1516,6 +1590,7 @@ local function register_biomes()
heat_point = 94,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 6,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1533,6 +1608,7 @@ local function register_biomes()
heat_point = 94,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 6,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1551,6 +1627,7 @@ local function register_biomes()
heat_point = 94,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1570,6 +1647,7 @@ local function register_biomes()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 28,
_mcl_foliage_palette_index = 5,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1587,6 +1665,7 @@ local function register_biomes()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 28,
_mcl_foliage_palette_index = 5,
_mcl_skycolor = "#78A7FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1605,6 +1684,7 @@ local function register_biomes()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 28,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1627,6 +1707,7 @@ local function register_biomes()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 29,
_mcl_foliage_palette_index = 17,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1645,6 +1726,7 @@ local function register_biomes()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 29,
_mcl_foliage_palette_index = 17,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1662,6 +1744,7 @@ local function register_biomes()
heat_point = 50,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 29,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1682,6 +1765,7 @@ local function register_biomes()
heat_point = 95,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 24,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1699,6 +1783,7 @@ local function register_biomes()
heat_point = 95,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 24,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1717,6 +1802,7 @@ local function register_biomes()
heat_point = 90,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 24,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1737,6 +1823,7 @@ local function register_biomes()
heat_point = 95,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 25,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1754,6 +1841,7 @@ local function register_biomes()
heat_point = 90,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 25,
_mcl_foliage_palette_index = 12,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1772,6 +1860,7 @@ local function register_biomes()
heat_point = 95,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 25,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1791,6 +1880,7 @@ local function register_biomes()
heat_point = 90,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 26,
_mcl_foliage_palette_index = 13,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1808,6 +1898,7 @@ local function register_biomes()
heat_point = 88,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 26,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1830,6 +1921,7 @@ local function register_biomes()
heat_point = 95,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 13,
_mcl_skycolor = "#77A8FF",
_mcl_fogcolor = overworld_fogcolor
})
@ -1847,6 +1939,7 @@ local function register_biomes()
heat_point = 90,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 27,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1871,6 +1964,7 @@ local function register_biomes()
vertical_blend = 5,
_mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type,
_mcl_grass_palette_index = minetest.registered_biomes[biome]._mcl_grass_palette_index,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = ocean_skycolor,
_mcl_fogcolor = overworld_fogcolor
})
@ -1885,6 +1979,7 @@ local function register_biomes()
y_max = DEEP_OCEAN_MIN - 1,
_mcl_biome_type = minetest.registered_biomes[biome]._mcl_biome_type,
_mcl_grass_palette_index = minetest.registered_biomes[biome]._mcl_grass_palette_index,
_mcl_foliage_palette_index = minetest.registered_biomes[biome]._mcl_foliage_palette_index,
_mcl_skycolor = minetest.registered_biomes[biome]._mcl_skycolor,
_mcl_fogcolor = minetest.registered_biomes[biome]._mcl_fogcolor,
})
@ -1940,6 +2035,7 @@ local function register_dimension_biomes()
humidity_point = 0,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = nether_skycolor,
_mcl_fogcolor = "#330808"
})
@ -1971,6 +2067,7 @@ local function register_dimension_biomes()
humidity_point = 33,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = nether_skycolor,
_mcl_fogcolor = "#1B4745"
})
@ -2022,6 +2119,7 @@ local function register_dimension_biomes()
humidity_point = 47,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = nether_skycolor,
_mcl_fogcolor = "#330303"
})
@ -2051,6 +2149,7 @@ local function register_dimension_biomes()
humidity_point = 70,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = nether_skycolor,
_mcl_fogcolor = "#1A051A"
})
@ -2080,6 +2179,7 @@ local function register_dimension_biomes()
humidity_point = 80,
_mcl_biome_type = "hot",
_mcl_grass_palette_index = 17,
_mcl_foliage_palette_index = 3,
_mcl_skycolor = nether_skycolor,
_mcl_fogcolor = "#685F70"
})
@ -2134,6 +2234,7 @@ local function register_dimension_biomes()
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})
@ -2151,6 +2252,7 @@ local function register_dimension_biomes()
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})
@ -2168,6 +2270,7 @@ local function register_dimension_biomes()
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})
@ -2185,6 +2288,7 @@ local function register_dimension_biomes()
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})
@ -2202,6 +2306,7 @@ local function register_dimension_biomes()
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})
@ -2222,6 +2327,7 @@ local function register_dimension_biomes()
min_pos = {x = -1250, y = mcl_vars.mg_end_min, z = -1250},
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})
@ -2240,6 +2346,7 @@ local function register_dimension_biomes()
vertical_blend = 16,
_mcl_biome_type = "medium",
_mcl_grass_palette_index = 0,
_mcl_foliage_palette_index = 0,
_mcl_skycolor = end_skycolor,
_mcl_fogcolor = end_fogcolor
})

View File

@ -268,7 +268,7 @@ local function set_layers(data, area, content_id, check, min, max, minp, maxp, l
return lvm_used
end
local function set_palette(minp,maxp,data2,area,biomemap,nodes)
local function set_grass_palette(minp,maxp,data2,area,biomemap,nodes)
-- Flat area at y=0 to read biome 3 times faster than 5.3.0.get_biome_data(pos).biome: 43us vs 125us per iteration:
if not biomemap then return end
local aream = VoxelArea:new({MinEdge={x=minp.x, y=0, z=minp.z}, MaxEdge={x=maxp.x, y=0, z=maxp.z}})
@ -344,13 +344,15 @@ local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, bl
return lvm_used, lvm_used, deco, ores
end
local function block_fixes(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
local affected_grass_blocks = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"}
local function block_fixes_grass(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
local biomemap = minetest.get_mapgen_object("biomemap")
local lvm_used = false
local pr = PseudoRandom(blockseed)
if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then
-- Set param2 (=color) of nodes which use the grass colour palette.
lvm_used = set_palette(minp,maxp,data2,area,biomemap,{"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"})
lvm_used = set_grass_palette(minp,maxp,data2,area,biomemap,affected_grass_blocks)
end
return lvm_used
end
@ -382,7 +384,7 @@ mcl_mapgen_core.register_generator("end_fixes", end_basic, function(minp,maxp)
end, 9999, true)
if mg_name ~= "v6" and mg_name ~= "singlenode" then
mcl_mapgen_core.register_generator("block_fixes", block_fixes, nil, 9999, true)
mcl_mapgen_core.register_generator("block_fixes_grass", block_fixes_grass, nil, 9999, true)
end
if mg_name == "v6" then
@ -419,20 +421,64 @@ mcl_mapgen_core.register_generator("structures",nil, function(minp, maxp, blocks
end, 100, true)
minetest.register_lbm({
label = "Fix grass palette indexes",
label = "Fix grass palette indexes", -- This LBM fixes any incorrect grass palette indexes.
name = "mcl_mapgen_core:fix_grass_palette_indexes",
nodenames = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"},
run_at_every_load = true,
nodenames = affected_grass_blocks,
run_at_every_load = false,
action = function(pos, node)
if mg_name ~= "v6" and mg_name ~= "singlenode" then
local biome_data = minetest.get_biome_data(pos)
local biome = biome_data.biome
local biome_name = minetest.get_biome_name(biome)
local reg_biome = minetest.registered_biomes[biome_name]
if node.param2 ~= reg_biome._mcl_grass_palette_index then
node.param2 = reg_biome._mcl_grass_palette_index
local grass_palette_index = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
if node.param2 ~= grass_palette_index then
node.param2 = grass_palette_index
minetest.set_node(pos, node)
end
end
})
minetest.register_lbm({
label = "Fix foliage palette indexes", -- Set correct palette indexes of foliage in old mapblocks.
name = "mcl_mapgen_core:fix_foliage_palette_indexes",
nodenames = {"group:foliage_palette", "group:foliage_palette_wallmounted"},
run_at_every_load = false,
action = function(pos, node)
local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index
local noplconvert = {"mcl_mangrove:mangroveleaves", "mcl_core:vine"} -- These do not convert into player leaves.
if node.param2 == 1 and node.name ~= noplconvert then -- Convert old player leaves into the new versions.
node.param2 = foliage_palette_index
minetest.remove_node(pos) -- Required, since otherwise this conversion won't work.
minetest.place_node(vector.offset(pos, 0, 1, 0), node) -- Offset required, since otherwise the leaves sink one node for some reason.
elseif node.param2 ~= foliage_palette_index and node.name ~= "mcl_core:vine" then
node.param2 = foliage_palette_index
minetest.set_node(pos, node)
elseif node.name == "mcl_core:vine" then
local biome_param2 = foliage_palette_index
local rotation_param2 = node.param2
local final_param2 = (biome_param2 * 8) + rotation_param2
if node.param2 ~= final_param2 and rotation_param2 < 6 then
node.param2 = final_param2
minetest.set_node(pos, node)
end
end
end,
end
})
minetest.register_on_generated(function(minp, maxp, blockseed) -- Set correct palette indexes of foliage in new mapblocks.
local pos1, pos2 = vector.offset(minp, -16, -16, -16), vector.offset(maxp, 16, 16, 16)
local foliage = minetest.find_nodes_in_area(pos1, pos2, {"group:foliage_palette", "group:foliage_palette_wallmounted"})
for _, fpos in pairs(foliage) do
local fnode = minetest.get_node(fpos)
local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(fpos).foliage_palette_index
if fnode.param2 ~= foliage_palette_index and fnode.name ~= "mcl_core:vine" then
fnode.param2 = foliage_palette_index
minetest.set_node(fpos, fnode)
elseif fnode.name == "mcl_core:vine" then
local biome_param2 = foliage_palette_index
local rotation_param2 = fnode.param2
local final_param2 = (biome_param2 * 8) + rotation_param2
if fnode.param2 ~= final_param2 and rotation_param2 < 6 then
fnode.param2 = final_param2
minetest.set_node(fpos, fnode)
end
end
end
end
)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 214 B