Re-add Logistica compatibility

This commit is contained in:
2025-04-05 16:18:37 +02:00
parent 656e33737d
commit 8e4fdb217a
2 changed files with 26 additions and 7 deletions

View File

@@ -48,14 +48,17 @@ for _,name in ipairs(logistica.group_get_all_nodes_for_group("injectors")) do
minetest.override_item(name,override)
end
local function startNodeTimer(pos)
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
local function afterLogisticaAction(pos)
local def=minetest.registered_nodes[minetest.get_node(pos).name]
if def and def._industrialtest_self then
def._industrialtest_self:triggerIfNeeded(pos)
end
end
local function addLogisticaCompatibility(name)
local override={
_logistica_afterRequesterItemstackInsert=startNodeTimer,
_logistica_afterInjectorItemstackTake=startNodeTimer
_logistica_afterRequesterItemstackInsert=afterLogisticaAction,
_logistica_afterInjectorItemstackTake=afterLogisticaAction
}
minetest.override_item(name,override)
end