Add more sun textures, decouple some on_generated code to its appropriate biome files

This commit is contained in:
Juraj Vajda 2023-02-22 13:47:51 -05:00
parent 23012e3e18
commit a5ebce011f
16 changed files with 163 additions and 81 deletions

View File

@ -817,6 +817,14 @@ GNU Lesser General Public License v2.1 or later (see included LICENSE file)
- everness_coral_forest_sun.png - everness_coral_forest_sun.png
- everness_forsaken_tundra_sun.png - everness_forsaken_tundra_sun.png
- everness_forsaken_tundra_sun_tonemap.png - everness_forsaken_tundra_sun_tonemap.png
- everness_bamboo_forest_sun_tonemap.png
- everness_bamboo_forest_sun.png
- everness_bamboo_forest_sunrisebg.png
- everness_baobab_savanna_sun.png
- everness_crystal_forest_sun_tonemap.png
- everness_crystal_forest_sun.png
- everness_frosted_icesheet_sun_tonemap.png
- everness_frosted_icesheet_sun.png
**CC-BY-SA-4.0, Pixel Perfection by XSSheep**, https://minecraft.curseforge.com/projects/pixel-perfection-freshly-updated **CC-BY-SA-4.0, Pixel Perfection by XSSheep**, https://minecraft.curseforge.com/projects/pixel-perfection-freshly-updated

View File

@ -31,22 +31,11 @@ local c_forsaken_desert_chiseled_stone = minetest.get_content_id('everness:forsa
local c_forsaken_desert_brick = minetest.get_content_id('everness:forsaken_desert_brick') local c_forsaken_desert_brick = minetest.get_content_id('everness:forsaken_desert_brick')
local c_forsaken_desert_engraved_stone = minetest.get_content_id('everness:forsaken_desert_engraved_stone') local c_forsaken_desert_engraved_stone = minetest.get_content_id('everness:forsaken_desert_engraved_stone')
local deco_ids_baobab = { -- Localize data buffer table outside the loop, to be re-used for all
minetest.get_decoration_id('everness:baobab_savanna_baobab_tree_1'),
minetest.get_decoration_id('everness:baobab_savanna_baobab_tree_2')
}
if #deco_ids_baobab > 1 then
minetest.set_gen_notify('decoration', deco_ids_baobab)
end
-- Localise data buffer table outside the loop, to be re-used for all
-- mapchunks, therefore minimising memory use. -- mapchunks, therefore minimising memory use.
local data = {} local data = {}
minetest.register_on_generated(function(minp, maxp, blockseed) minetest.register_on_generated(function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object('gennotify')
local chance = 15 local chance = 15
local disp = 16 local disp = 16
local rotations = { '0', '90', '180', '270' } local rotations = { '0', '90', '180', '270' }
@ -63,57 +52,6 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
local z_disp = rand:next(0, disp) local z_disp = rand:next(0, disp)
if maxp.y > 0 then if maxp.y > 0 then
--
-- Baobab Tree - fix light
--
for _, deco_id in ipairs(deco_ids_baobab) do
for _, pos in ipairs(gennotify['decoration#' .. deco_id] or {}) do
minetest.fix_light(vector.offset(pos, -1, -1, -1), vector.offset(pos, 24, 39, 24))
end
end
--
-- Bamboo
--
local bamboos_pos = minetest.find_nodes_in_area_under_air(minp, maxp, 'everness:bamboo_3')
for _, pos in ipairs(bamboos_pos) do
local node_below = minetest.get_node(vector.new(pos.x, pos.y - 1, pos.z))
-- get height of the generated bamboo
local bamboo_height = 0
local height_offset = 1
local bamboo_below = node_below
while minetest.get_item_group(bamboo_below.name, 'bamboo') > 0 do
if bamboo_height > 1 then
bamboo_below = minetest.get_node(vector.new(pos.x, pos.y - height_offset, pos.z))
end
height_offset = height_offset + 1
bamboo_height = bamboo_height + 1
end
-- add top bamboo nodes with leaves based on their generated heigth
for i = 1, 3 do
local node_name = 'everness:bamboo_4'
if i == 2 and bamboo_height > 4 then
node_name = 'everness:bamboo_5'
elseif i == 3 then
node_name = 'everness:bamboo_5'
end
minetest.swap_node(
vector.new(pos.x, pos.y + (i - 1), pos.z),
{
name = node_name,
param2 = node_below.param2
}
)
end
end
for y = minp.y, maxp.y do for y = minp.y, maxp.y do
local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp) local vi = area:index(minp.x + sidelength / 2 + x_disp, y, minp.z + sidelength / 2 + z_disp)

View File

@ -226,3 +226,53 @@ register_flower(36662, 'geranium')
register_flower(1133, 'viola') register_flower(1133, 'viola')
register_flower(73133, 'dandelion_white') register_flower(73133, 'dandelion_white')
register_flower(42, 'tulip_black') register_flower(42, 'tulip_black')
--
-- On Generated
--
minetest.register_on_generated(function(minp, maxp, blockseed)
if maxp.y > 0 then
--
-- Bamboo
--
local bamboos_pos = minetest.find_nodes_in_area_under_air(minp, maxp, 'everness:bamboo_3')
for _, pos in ipairs(bamboos_pos) do
local node_below = minetest.get_node(vector.new(pos.x, pos.y - 1, pos.z))
-- get height of the generated bamboo
local bamboo_height = 0
local height_offset = 1
local bamboo_below = node_below
while minetest.get_item_group(bamboo_below.name, 'bamboo') > 0 do
if bamboo_height > 1 then
bamboo_below = minetest.get_node(vector.new(pos.x, pos.y - height_offset, pos.z))
end
height_offset = height_offset + 1
bamboo_height = bamboo_height + 1
end
-- add top bamboo nodes with leaves based on their generated heigth
for i = 1, 3 do
local node_name = 'everness:bamboo_4'
if i == 2 and bamboo_height > 4 then
node_name = 'everness:bamboo_5'
elseif i == 3 then
node_name = 'everness:bamboo_5'
end
minetest.swap_node(
vector.new(pos.x, pos.y + (i - 1), pos.z),
{
name = node_name,
param2 = node_below.param2
}
)
end
end
end
end)

View File

@ -141,3 +141,31 @@ minetest.register_decoration({
spawn_by = 'default:dry_dirt_with_dry_grass', spawn_by = 'default:dry_dirt_with_dry_grass',
num_spawn_by = 8, num_spawn_by = 8,
}) })
--
-- On Generated
--
local deco_ids_baobab = {
minetest.get_decoration_id('everness:baobab_savanna_baobab_tree_1'),
minetest.get_decoration_id('everness:baobab_savanna_baobab_tree_2')
}
if #deco_ids_baobab > 1 then
minetest.set_gen_notify('decoration', deco_ids_baobab)
end
minetest.register_on_generated(function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object('gennotify')
if maxp.y > 0 then
--
-- Baobab Tree - fix light
--
for _, deco_id in ipairs(deco_ids_baobab) do
for _, pos in ipairs(gennotify['decoration#' .. deco_id] or {}) do
minetest.fix_light(vector.offset(pos, -1, -1, -1), vector.offset(pos, 24, 39, 24))
end
end
end
end)

View File

@ -225,10 +225,12 @@ minetest.set_gen_notify('decoration', { deco_id_coral_bones_tree })
minetest.register_on_generated(function(minp, maxp, blockseed) minetest.register_on_generated(function(minp, maxp, blockseed)
local gennotify = minetest.get_mapgen_object('gennotify') local gennotify = minetest.get_mapgen_object('gennotify')
if maxp.y > 0 then
-- --
-- Coral bone tree - fix light -- Coral bone tree - fix light
-- --
for _, pos in ipairs(gennotify['decoration#' .. deco_id_coral_bones_tree] or {}) do for _, pos in ipairs(gennotify['decoration#' .. deco_id_coral_bones_tree] or {}) do
minetest.fix_light(vector.offset(pos, -1, -1, -1), vector.offset(pos, 14, 35, 14)) minetest.fix_light(vector.offset(pos, -1, -1, -1), vector.offset(pos, 14, 35, 14))
end end
end
end) end)

View File

@ -191,7 +191,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_coral_forest_sun.png', texture = 'everness_coral_forest_sun.png',
scale = 1.57, scale = 1.57,
tonemap = 'everness_coral_forest_sun_tonemap.png' tonemap = 'everness_coral_forest_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_coral_forest_dunes = { everness_coral_forest_dunes = {
@ -213,7 +214,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_coral_forest_sun.png', texture = 'everness_coral_forest_sun.png',
scale = 1.57, scale = 1.57,
tonemap = 'everness_coral_forest_sun_tonemap.png' tonemap = 'everness_coral_forest_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_coral_forest_ocean = { everness_coral_forest_ocean = {
@ -235,7 +237,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_coral_forest_sun.png', texture = 'everness_coral_forest_sun.png',
scale = 1.57, scale = 1.57,
tonemap = 'everness_coral_forest_sun_tonemap.png' tonemap = 'everness_coral_forest_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_coral_forest_under = { everness_coral_forest_under = {
@ -273,6 +276,12 @@ local skybox_defs = {
fog_moon_tint = '#51c751' fog_moon_tint = '#51c751'
} }
}, },
sun_parameters = {
texture = 'everness_bamboo_forest_sun.png',
scale = 1.57,
tonemap = 'everness_bamboo_forest_sun_tonemap.png',
sunrise = 'everness_bamboo_forest_sunrisebg.png',
},
}, },
everness_bamboo_forest_under = { everness_bamboo_forest_under = {
sky_parameters = { sky_parameters = {
@ -308,6 +317,12 @@ local skybox_defs = {
fog_moon_tint = '#91989e' fog_moon_tint = '#91989e'
} }
}, },
sun_parameters = {
texture = 'everness_frosted_icesheet_sun.png',
scale = 1.57,
tonemap = 'everness_frosted_icesheet_sun_tonemap.png',
sunrise = ''
},
}, },
everness_frosted_icesheet_ocean = { everness_frosted_icesheet_ocean = {
sky_parameters = { sky_parameters = {
@ -324,6 +339,12 @@ local skybox_defs = {
fog_moon_tint = '#91989e' fog_moon_tint = '#91989e'
} }
}, },
sun_parameters = {
texture = 'everness_frosted_icesheet_sun.png',
scale = 1.57,
tonemap = 'everness_frosted_icesheet_sun_tonemap.png',
sunrise = ''
},
}, },
everness_frosted_icesheet_under = { everness_frosted_icesheet_under = {
sky_parameters = { sky_parameters = {
@ -364,7 +385,13 @@ local skybox_defs = {
star_parameters = { star_parameters = {
count = 6000, count = 6000,
scale = 0.5 scale = 0.5
} },
sun_parameters = {
texture = 'everness_crystal_forest_sun.png',
scale = 1.57,
tonemap = 'everness_crystal_forest_sun_tonemap.png',
sunrise = ''
},
}, },
everness_crystal_forest_dunes = { everness_crystal_forest_dunes = {
sky_parameters = { sky_parameters = {
@ -389,7 +416,13 @@ local skybox_defs = {
star_parameters = { star_parameters = {
count = 6000, count = 6000,
scale = 0.5 scale = 0.5
} },
sun_parameters = {
texture = 'everness_crystal_forest_sun.png',
scale = 1.57,
tonemap = 'everness_crystal_forest_sun_tonemap.png',
sunrise = ''
},
}, },
everness_crystal_forest_shore = { everness_crystal_forest_shore = {
sky_parameters = { sky_parameters = {
@ -414,7 +447,13 @@ local skybox_defs = {
star_parameters = { star_parameters = {
count = 6000, count = 6000,
scale = 0.5 scale = 0.5
} },
sun_parameters = {
texture = 'everness_crystal_forest_sun.png',
scale = 1.57,
tonemap = 'everness_crystal_forest_sun_tonemap.png',
sunrise = ''
},
}, },
everness_crystal_forest_ocean = { everness_crystal_forest_ocean = {
sky_parameters = { sky_parameters = {
@ -439,7 +478,13 @@ local skybox_defs = {
star_parameters = { star_parameters = {
count = 6000, count = 6000,
scale = 0.5 scale = 0.5
} },
sun_parameters = {
texture = 'everness_crystal_forest_sun.png',
scale = 1.57,
tonemap = 'everness_crystal_forest_sun_tonemap.png',
sunrise = ''
},
}, },
everness_crystal_forest_under = { everness_crystal_forest_under = {
sky_parameters = { sky_parameters = {
@ -480,7 +525,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_forsaken_desert_sun.png', texture = 'everness_forsaken_desert_sun.png',
scale = 3.14, scale = 3.14,
tonemap = 'everness_forsaken_desert_sun_tonemap.png' tonemap = 'everness_forsaken_desert_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_forsaken_desert_ocean = { everness_forsaken_desert_ocean = {
@ -501,7 +547,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_forsaken_desert_sun.png', texture = 'everness_forsaken_desert_sun.png',
scale = 3.14, scale = 3.14,
tonemap = 'everness_forsaken_desert_sun_tonemap.png' tonemap = 'everness_forsaken_desert_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_forsaken_desert_under = { everness_forsaken_desert_under = {
@ -534,7 +581,13 @@ local skybox_defs = {
fog_sun_tint = '#b79449', fog_sun_tint = '#b79449',
fog_moon_tint = '#b8954a' fog_moon_tint = '#b8954a'
} }
} },
sun_parameters = {
texture = 'everness_baobab_savanna_sun.png',
scale = 1.57,
tonemap = '',
sunrise = ''
},
}, },
everness_forsaken_tundra = { everness_forsaken_tundra = {
sky_parameters = { sky_parameters = {
@ -556,7 +609,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_forsaken_tundra_sun.png', texture = 'everness_forsaken_tundra_sun.png',
scale = 1.57, scale = 1.57,
tonemap = 'everness_forsaken_tundra_sun_tonemap.png' tonemap = 'everness_forsaken_tundra_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_forsaken_tundra_beach = { everness_forsaken_tundra_beach = {
@ -579,7 +633,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_forsaken_tundra_sun.png', texture = 'everness_forsaken_tundra_sun.png',
scale = 1.57, scale = 1.57,
tonemap = 'everness_forsaken_tundra_sun_tonemap.png' tonemap = 'everness_forsaken_tundra_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_forsaken_tundra_ocean = { everness_forsaken_tundra_ocean = {
@ -602,7 +657,8 @@ local skybox_defs = {
sun_parameters = { sun_parameters = {
texture = 'everness_forsaken_tundra_sun.png', texture = 'everness_forsaken_tundra_sun.png',
scale = 1.57, scale = 1.57,
tonemap = 'everness_forsaken_tundra_sun_tonemap.png' tonemap = 'everness_forsaken_tundra_sun_tonemap.png',
sunrise = ''
}, },
}, },
everness_forsaken_tundra_under = { everness_forsaken_tundra_under = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B