Add Ceiling With WIP Texture

Tweak colors and light-levels
Fix warehouse lights having white-edge
master
benrob0329 2019-11-11 01:22:18 -05:00
parent 97c672aa0f
commit 9d7d682b30
4 changed files with 33 additions and 2 deletions

View File

@ -30,6 +30,7 @@ function ikea.mapgen.every_n_mapblocks(n)
end
end
-- Big mapgen function, places schematics if should_place and then calls on_place
minetest.register_on_generated(function(minp, maxp, seed)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
@ -62,3 +63,33 @@ minetest.register_on_generated(function(minp, maxp, seed)
vm:update_liquids()
vm:write_to_map()
end)
-- Ceiling
ikea.mapgen.ceiling_height = tonumber(minetest.settings:get("mgflat_ground_level") or 8) + 50
minetest.register_node(":mapgen:ceiling", {
paramtype = "light",
description = "Ceiling Node (You Hacker!)",
tiles = {{name = "ikea_mapgen_ceiling.png", scale = 16, align_style = "world"}},
groups = {static = 1},
sunlight_propagates = true,
})
local ceiling_schematic = {
size = {x=16, y=1, z=16},
data = {},
}
for i=1,256 do
table.insert(ceiling_schematic.data, {name = "mapgen:ceiling"})
end
ikea.mapgen.register_schematic({
schematic = ceiling_schematic,
place_on = "air",
should_place = function(x,y,z)
if y == ikea.mapgen.ceiling_height then return true end
end,
force_placement = true,
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,6 +1,6 @@
ikea.time = {}
ikea.time.day_color = "#91939e"
ikea.time.day_color = "#414141"
ikea.time.night_color = "#303030"
-- Returns 1 for open hours and 0 for closed
@ -18,7 +18,7 @@ function ikea.time.set_player_time(player)
local time = ikea.time.get_storetime()
if time == 1 then
player:override_day_night_ratio(0.9)
player:override_day_night_ratio(0.7)
player:set_sky(ikea.time.day_color, "plain", {}, false)
else
player:override_day_night_ratio(0)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB