Add few callback methods to Machine

This commit is contained in:
mrkubax10 2025-03-19 22:14:52 +01:00
parent 29662f1821
commit b3d08d965c

View File

@ -26,6 +26,10 @@ function industrialtest.Machine.onDestruct(self)
-- dummy function
end
function industrialtest.Machine.afterPlaceNode(self,pos,placer,itemstack,pointed)
-- dummy function
end
function industrialtest.Machine.getFormspec(self,pos)
local formspec
if industrialtest.mtgAvailable then
@ -147,6 +151,10 @@ function industrialtest.Machine.onMetadataInventoryTake(self,pos,listname,index,
end
end
function industrialtest.Machine.onReceiveFields(self,pos,formname,fields)
-- dummy function
end
function industrialtest.Machine.createDefinitionTable(self)
local def={
description=self.description,
@ -157,6 +165,9 @@ function industrialtest.Machine.createDefinitionTable(self)
on_destruct=function(pos)
self:onDestruct(pos)
end,
after_place_node=function(pos,placer,itemstack,pointed)
self:afterPlaceNode(pos,placer,itemstack,pointed)
end,
on_timer=function(pos,elapsed)
return self:onTimer(pos,elapsed)
end,
@ -178,6 +189,9 @@ function industrialtest.Machine.createDefinitionTable(self)
on_metadata_inventory_take=function(pos,listname,index,stack,player)
self:onMetadataInventoryTake(pos,listname,index,stack)
end,
on_receive_fields=function(pos,formname,fields)
self:onReceiveFields(pos,formname,fields)
end,
_industrialtest_self=self
}