Make dropped items glow if light source node

This commit is contained in:
Wuzzy 2019-12-14 17:40:16 +01:00
parent 41d7e513e7
commit 7f70acc8a4

@ -359,6 +359,11 @@ core.register_entity(":__builtin:item", {
item_type = core.registered_items[itemname].type item_type = core.registered_items[itemname].type
description = core.registered_items[itemname].description description = core.registered_items[itemname].description
end end
local ndef = core.registered_items[itemname]
local glow
if ndef then
glow = ndef.light_source
end
local prop = { local prop = {
is_visible = true, is_visible = true,
visual = "wielditem", visual = "wielditem",
@ -367,6 +372,7 @@ core.register_entity(":__builtin:item", {
collisionbox = {-c, -c, -c, c, c, c}, collisionbox = {-c, -c, -c, c, c, c},
automatic_rotate = math.pi * 0.5, automatic_rotate = math.pi * 0.5,
infotext = description, infotext = description,
glow = glow,
} }
self.object:set_properties(prop) self.object:set_properties(prop)
if item_drop_settings.random_item_velocity == true then if item_drop_settings.random_item_velocity == true then