Aaron Suen 3200149cc4 Buff torch and scaling light sources.
- Better compat with low gamma play.
- Torch now emits some light when in inventory, even
  if not actively wielded.
- Dynamic light API for mod use.
2020-02-22 21:57:08 -05:00

32 lines
848 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore
= minetest, nodecore
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local function reg(name, climb, light, fx, lv)
local def = {
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
buildable_to = true,
air_equivalent = true,
climbable = climb and true or nil,
light_source = light or nil,
groups = {
[modname] = lv,
[modname .. "_fx"] = fx and 1 or nil
}
}
return minetest.register_node(modname .. ":" .. name, def)
end
local ll = nodecore.scaling_light_level
reg("ceil", true, ll, true, 4)
reg("wall", true, ll, true, 3)
reg("floor", nil, ll, nil, 2)
reg("hang", true, nil, nil, 1)