techage/iron_age/hopper.lua

55 lines
887 B
Lua
Raw Normal View History

2019-04-30 23:45:28 +03:00
--[[
TechAge
=======
Copyright (C) 2019 Joachim Stolberg
GPL v3
2019-04-30 23:45:28 +03:00
See LICENSE.txt for more information
2019-05-01 13:01:24 +03:00
Simple TA1 Hopper
2019-04-30 23:45:28 +03:00
]]--
-- use the minecart hopper
minetest.register_alias("techage:hopper_ta1", "minecart:hopper")
minecart.register_inventory(
{
"techage:chest_ta3", "techage:chest_ta4",
"techage:meltingpot", "techage:meltingpot_active",
},
{
put = {
listname = "main",
},
take = {
listname = "main",
},
}
)
minecart.register_inventory(
{
"techage:sieve0", "techage:sieve1", "techage:sieve2", "techage:sieve3",
},
{
put = {
allow_inventory_put = function(pos, stack, player_name)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:is_empty("src") then
minetest.get_node_timer(pos):start(1)
return true
2019-04-30 23:45:28 +03:00
end
end,
listname = "src",
2019-04-30 23:45:28 +03:00
},
take = {
listname = "src",
2019-04-30 23:45:28 +03:00
},
}
)