Add darkness_nerf until MTE fixes their lighting
This commit is contained in:
parent
ce9760c7c8
commit
82d9226d08
2 changed files with 26 additions and 0 deletions
24
mods/other/darkness_nerf/init.lua
Normal file
24
mods/other/darkness_nerf/init.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
minetest.register_on_joinplayer(function(player)
|
||||
player:set_properties({glow = 3})
|
||||
end)
|
||||
|
||||
local MIN_GLOW = 8
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
local itemdef = minetest.registered_entities["__builtin:item"]
|
||||
local old_set_item = itemdef.set_item
|
||||
|
||||
itemdef.set_item = function(self, itemstring)
|
||||
old_set_item(self, itemstring)
|
||||
local iname = itemstring or self.itemstring
|
||||
iname = ItemStack(iname):get_name()
|
||||
|
||||
if not minetest.registered_items[iname] or (minetest.registered_items[iname].light_source or 0) < MIN_GLOW then
|
||||
self.object:set_properties({glow = MIN_GLOW})
|
||||
else
|
||||
self.object:set_properties({glow = minetest.registered_items[iname].light_source})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_entity(":__builtin:item", itemdef)
|
||||
end)
|
2
mods/other/darkness_nerf/mod.conf
Normal file
2
mods/other/darkness_nerf/mod.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = darkness_nerf
|
||||
depends = default
|
Loading…
Reference in a new issue