mirror of
https://github.com/minetest/minetest.git
synced 2024-11-04 23:03:46 +01:00
Fix dropped craftitems/tools not using light_source values (#9438)
This commit is contained in:
parent
5c4b560b68
commit
c18dbadcb8
@ -54,7 +54,7 @@ core.register_entity(":__builtin:item", {
|
|||||||
local max_count = stack:get_stack_max()
|
local max_count = stack:get_stack_max()
|
||||||
local count = math.min(stack:get_count(), max_count)
|
local count = math.min(stack:get_count(), max_count)
|
||||||
local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3)
|
local size = 0.2 + 0.1 * (count / max_count) ^ (1 / 3)
|
||||||
local def = core.registered_nodes[itemname]
|
local def = core.registered_items[itemname]
|
||||||
local glow = def and math.floor(def.light_source / 2 + 0.5)
|
local glow = def and math.floor(def.light_source / 2 + 0.5)
|
||||||
|
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
|
@ -7026,6 +7026,13 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
|
|||||||
|
|
||||||
liquids_pointable = false,
|
liquids_pointable = false,
|
||||||
|
|
||||||
|
light_source = 0,
|
||||||
|
-- When used for nodes: Defines amount of light emitted by node.
|
||||||
|
-- Otherwise: Defines texture glow when viewed as a dropped item
|
||||||
|
-- To set the maximum (14), use the value 'minetest.LIGHT_MAX'.
|
||||||
|
-- A value outside the range 0 to minetest.LIGHT_MAX causes undefined
|
||||||
|
-- behavior.
|
||||||
|
|
||||||
-- See "Tools" section for an example including explanation
|
-- See "Tools" section for an example including explanation
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
@ -7225,12 +7232,6 @@ Used by `minetest.register_node`.
|
|||||||
drowning = 0,
|
drowning = 0,
|
||||||
-- Player will take this amount of damage if no bubbles are left
|
-- Player will take this amount of damage if no bubbles are left
|
||||||
|
|
||||||
light_source = 0,
|
|
||||||
-- Amount of light emitted by node.
|
|
||||||
-- To set the maximum (14), use the value 'minetest.LIGHT_MAX'.
|
|
||||||
-- A value outside the range 0 to minetest.LIGHT_MAX causes undefined
|
|
||||||
-- behavior.
|
|
||||||
|
|
||||||
damage_per_second = 0,
|
damage_per_second = 0,
|
||||||
-- If player is inside node, this damage is caused
|
-- If player is inside node, this damage is caused
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user