add dtime to custom on_step
This commit is contained in:
parent
a20158a059
commit
db14f55e5f
@ -10,7 +10,7 @@ Features:
|
|||||||
- Particle effects added
|
- Particle effects added
|
||||||
- Dropped items slide on nodes with {slippery} groups
|
- Dropped items slide on nodes with {slippery} groups
|
||||||
- Items stuck inside solid nodes move to nearest empty space
|
- Items stuck inside solid nodes move to nearest empty space
|
||||||
- Added 'dropped_step(self, pos)' function for special features for dropped item
|
- Added 'dropped_step(self, pos, dtime)' custom on_step for dropped items
|
||||||
'self.node_inside' contains node table that item is inside
|
'self.node_inside' contains node table that item is inside
|
||||||
'self.def_inside' contains node definition for above
|
'self.def_inside' contains node definition for above
|
||||||
'self.node_under' contains node table that is below item
|
'self.node_under' contains node table that is below item
|
||||||
@ -18,6 +18,7 @@ Features:
|
|||||||
'self.age' holds age of dropped item in seconds
|
'self.age' holds age of dropped item in seconds
|
||||||
'self.itemstring' contains itemstring e.g. "default:dirt", "default:ice 20"
|
'self.itemstring' contains itemstring e.g. "default:dirt", "default:ice 20"
|
||||||
'pos' holds position of dropped item
|
'pos' holds position of dropped item
|
||||||
|
'dtime' used for timers
|
||||||
|
|
||||||
return false to skip further checks by builtin_item
|
return false to skip further checks by builtin_item
|
||||||
|
|
||||||
|
2
init.lua
2
init.lua
@ -305,7 +305,7 @@ core.register_entity(":__builtin:item", {
|
|||||||
local custom = core.registered_items[name]
|
local custom = core.registered_items[name]
|
||||||
and core.registered_items[name].dropped_step
|
and core.registered_items[name].dropped_step
|
||||||
|
|
||||||
if custom and custom(self, pos) == false then
|
if custom and custom(self, pos, dtime) == false then
|
||||||
return -- skip further checks if false
|
return -- skip further checks if false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user