add dtime to custom on_step

This commit is contained in:
TenPlus1 2018-08-16 20:31:25 +01:00
parent a20158a059
commit db14f55e5f
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ Features:
- Particle effects added
- Dropped items slide on nodes with {slippery} groups
- 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.def_inside' contains node definition for above
'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.itemstring' contains itemstring e.g. "default:dirt", "default:ice 20"
'pos' holds position of dropped item
'dtime' used for timers
return false to skip further checks by builtin_item

View File

@ -305,7 +305,7 @@ core.register_entity(":__builtin:item", {
local custom = core.registered_items[name]
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
end