Implement Canning Machine

This commit is contained in:
2024-01-12 20:17:36 +01:00
parent eaff4a9065
commit 6cf004ff0e
5 changed files with 319 additions and 9 deletions

View File

@@ -221,6 +221,13 @@ machine.allowMetadataInventoryPut=function(pos,listname,index,stack,player,confi
return stack:get_count()
end
machine.allowMetadataInventoryTake=function(pos,listname,index,stack,player,config)
if config.allowMetadataInventoryTake then
return config.allowMetadataInventoryTake(pos,listname,index,stack,player)
end
return stack:get_count()
end
machine.onMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
if toList=="upgrades" then
local meta=minetest.get_meta(pos)
@@ -274,6 +281,9 @@ function industrialtest.internal.registerMachine(config)
allow_metadata_inventory_put=function(pos,listname,index,stack,player)
return machine.allowMetadataInventoryPut(pos,listname,index,stack,player,config)
end,
allow_metadata_inventory_take=function(pos,listname,index,stack,player)
return machine.allowMetadataInventoryTake(pos,listname,index,stack,player,config)
end,
on_metadata_inventory_put=function(pos,listname,index,stack,player)
machine.onMetadataInventoryPut(pos,listname,index,stack)
if config.onMetadataInventoryPut then