Refactor power storage
This commit is contained in:
@@ -98,7 +98,7 @@ function industrialtest.ElectricMachine.allowMetadataInventoryMove(self,pos,from
|
||||
local found=false
|
||||
if self.powerLists then
|
||||
for _,value in ipairs(self.powerLists) do
|
||||
if value==toList then
|
||||
if value.list==toList then
|
||||
found=true
|
||||
break
|
||||
end
|
||||
@@ -115,7 +115,7 @@ function industrialtest.ElectricMachine.allowMetadataInventoryPut(self,pos,listn
|
||||
local found=false
|
||||
if self.powerLists then
|
||||
for _,value in ipairs(self.powerLists) do
|
||||
if value==listname then
|
||||
if value.list==listname then
|
||||
found=true
|
||||
break
|
||||
end
|
||||
@@ -129,15 +129,25 @@ function industrialtest.ElectricMachine.allowMetadataInventoryPut(self,pos,listn
|
||||
end
|
||||
|
||||
function industrialtest.ElectricMachine.onMetadataInventoryMove(self,pos,fromList,fromIndex,toList,toIndex,count)
|
||||
if toList=="charged" then
|
||||
self:trigger(pos)
|
||||
if self.powerLists then
|
||||
for _,value in ipairs(self.powerLists) do
|
||||
if value.list==toList then
|
||||
self:trigger(pos)
|
||||
break
|
||||
end
|
||||
end
|
||||
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)
|
||||
if self.powerLists then
|
||||
for _,value in ipairs(self.powerLists) do
|
||||
if value.list==listname then
|
||||
self:trigger(pos)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
industrialtest.Machine.onMetadataInventoryPut(self,pos,listname,index,stack)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user