Fix clocks not updating in itemframes

This commit is contained in:
cora 2024-12-16 16:57:26 +01:00 committed by cora
parent fb1464615c
commit 4c3b327e70

View File

@ -202,6 +202,10 @@ function mcl_itemframes.tpl_entity:on_activate(staticdata, dtime_s)
end end
function mcl_itemframes.tpl_entity:on_step(dtime) function mcl_itemframes.tpl_entity:on_step(dtime)
local def = minetest.registered_items[self._item]
if def and def._on_entity_step then
def._on_entity_step(self, dtime)
end
self._timer = (self._timer and self._timer - dtime) or 1 self._timer = (self._timer and self._timer - dtime) or 1
if self._timer > 0 then return end if self._timer > 0 then return end
self._timer = 1 self._timer = 1
@ -209,9 +213,6 @@ function mcl_itemframes.tpl_entity:on_step(dtime)
self.object:remove() self.object:remove()
return return
end end
if minetest.get_item_group(self._item, "clock") > 0 then
self:set_item(ItemStack("mcl_clock:clock_"..mcl_clock.get_clock_frame()))
end
end end
function mcl_itemframes.register_itemframe(name, def) function mcl_itemframes.register_itemframe(name, def)