Skip to content

Commit

Permalink
Builtin: Make dropped light_source nodes glow (#9200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 authored and SmallJoker committed Dec 19, 2019
1 parent 80af58c commit 4b9fabf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin/game/item_entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ core.register_entity(":__builtin:item", {
local count = math.min(stack:get_count(), max_count)
local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3)
local coll_height = size * 0.75
local def = core.registered_nodes[itemname]
local glow = def and def.light_source

self.object:set_properties({
is_visible = true,
Expand All @@ -69,6 +71,7 @@ core.register_entity(":__builtin:item", {
selectionbox = {-size, -size, -size, size, size, size},
automatic_rotate = math.pi * 0.5 * 0.2 / size,
wield_item = self.itemstring,
glow = glow,
})

end,
Expand Down

0 comments on commit 4b9fabf

Please sign in to comment.