projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80af58c
)
Builtin: Make dropped light_source nodes glow (#9200)
author
Wuzzy
<wuzzy2@mail.ru>
Thu, 19 Dec 2019 18:41:44 +0000
(18:41 +0000)
committer
SmallJoker
<SmallJoker@users.noreply.github.com>
Thu, 19 Dec 2019 18:41:44 +0000
(19:41 +0100)
builtin/game/item_entity.lua
patch
|
blob
|
history
diff --git
a/builtin/game/item_entity.lua
b/builtin/game/item_entity.lua
index 87fec93ea5349532a757a79a06faf2f2b15ba09f..1d66799f64d5c18e528164a79f814969676ceb69 100644
(file)
--- a/
builtin/game/item_entity.lua
+++ b/
builtin/game/item_entity.lua
@@
-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,
@@
-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,