From b3d08d965cd7b8e6c517a141b9f1ba7fc854efe7 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Wed, 19 Mar 2025 22:14:52 +0100 Subject: [PATCH] Add few callback methods to `Machine` --- machines/machine.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/machines/machine.lua b/machines/machine.lua index a33039b..3c4f945 100644 --- a/machines/machine.lua +++ b/machines/machine.lua @@ -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 }