Implement Power Storage Upgrade

This commit is contained in:
2023-11-26 15:16:32 +01:00
parent 4f8acd7a86
commit 18a8e235f6
2 changed files with 42 additions and 7 deletions

View File

@@ -226,26 +226,26 @@ machine.onMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,c
local meta=minetest.get_meta(pos)
local inv=meta:get_inventory()
local stack=inv:get_stack(fromList,fromIndex)
industrialtest.internal.applyUpgrade(meta,stack)
industrialtest.internal.applyUpgrade(pos,meta,stack)
elseif fromList=="upgrades" then
local meta=minetest.get_meta(pos)
local inv=meta:get_inventory()
local stack=inv:get_stack(fromList,fromIndex)
industrialtest.internal.removeUpgrade(meta,stack)
industrialtest.internal.removeUpgrade(pos,meta,stack)
end
end
machine.onMetadataInventoryPut=function(pos,listname,index,stack)
if listname=="upgrades" then
local meta=minetest.get_meta(pos)
industrialtest.internal.applyUpgrade(meta,stack)
industrialtest.internal.applyUpgrade(pos,meta,stack)
end
end
machine.onMetadataInventoryTake=function(pos,listname,index,stack)
if listname=="upgrades" then
local meta=minetest.get_meta(pos)
industrialtest.internal.removeUpgrade(meta,stack)
industrialtest.internal.removeUpgrade(pos,meta,stack)
end
end