diff --git a/machines/electric_machine.lua b/machines/electric_machine.lua index 2134728..3096201 100644 --- a/machines/electric_machine.lua +++ b/machines/electric_machine.lua @@ -128,6 +128,20 @@ function industrialtest.ElectricMachine.allowMetadataInventoryPut(self,pos,listn return industrialtest.Machine.allowMetadataInventoryPut(self,pos,listname,index,stack,player) end +function industrialtest.ElectricMachine.onMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count) + if toList=="charged" then + self:trigger(pos) + end + industrialtest.Machine.onMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count) +end + +function industrialtest.ElectricMachine.onMetadataInventoryPut(self,pos,listname,index,stack) + if listname=="charged" then + self:trigger(pos) + end + industrialtest.Machine.onMetadataInventoryPut(self,pos,listname,index,stack) +end + function industrialtest.ElectricMachine.requestPower(self,pos) if not self.hasPowerOutput then return