2019-04-30 23:45:28 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
TechAge
|
|
|
|
=======
|
|
|
|
|
|
|
|
Copyright (C) 2019 Joachim Stolberg
|
|
|
|
|
2020-10-19 20:09:17 +03:00
|
|
|
AGPL v3
|
2019-04-30 23:45:28 +03:00
|
|
|
See LICENSE.txt for more information
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-05-01 13:01:24 +03:00
|
|
|
Simple TA1 Hopper
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-04-30 23:45:28 +03:00
|
|
|
]]--
|
|
|
|
|
2020-02-16 20:10:40 +03:00
|
|
|
-- Consumer Related Data
|
|
|
|
local CRD = function(pos) return (minetest.registered_nodes[techage.get_node_lvm(pos).name] or {}).consumer end
|
|
|
|
|
2020-02-15 00:59:16 +03:00
|
|
|
-- use the minecart hopper
|
|
|
|
minetest.register_alias("techage:hopper_ta1", "minecart:hopper")
|
|
|
|
|
|
|
|
|
|
|
|
minecart.register_inventory(
|
|
|
|
{
|
2020-02-24 22:59:26 +03:00
|
|
|
"techage:chest_ta2", "techage:chest_ta3", "techage:chest_ta4",
|
2022-09-11 15:32:59 +03:00
|
|
|
"techage:meltingpot", "techage:meltingpot_active", "techage:ta4_reactor",
|
2022-01-03 23:40:31 +03:00
|
|
|
},
|
2020-02-15 00:59:16 +03:00
|
|
|
{
|
|
|
|
put = {
|
|
|
|
listname = "main",
|
|
|
|
},
|
|
|
|
take = {
|
|
|
|
listname = "main",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-02-16 20:10:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minecart.register_inventory(
|
|
|
|
{
|
|
|
|
"techage:ta2_distributor_pas", "techage:ta2_distributor_act",
|
|
|
|
"techage:ta3_distributor_pas", "techage:ta3_distributor_act",
|
|
|
|
"techage:ta4_distributor_pas", "techage:ta4_distributor_act",
|
2020-10-03 16:27:04 +03:00
|
|
|
"techage:ta4_high_performance_distributor_pas", "techage:ta4_high_performance_distributor_act",
|
|
|
|
},
|
2020-02-16 20:10:40 +03:00
|
|
|
{
|
|
|
|
put = {
|
|
|
|
allow_inventory_put = function(pos, stack, player_name)
|
|
|
|
CRD(pos).State:start_if_standby(pos)
|
|
|
|
return true
|
2022-01-03 23:40:31 +03:00
|
|
|
end,
|
2020-02-16 20:10:40 +03:00
|
|
|
listname = "src",
|
|
|
|
},
|
|
|
|
take = {
|
|
|
|
listname = "src",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2020-02-15 00:59:16 +03:00
|
|
|
minecart.register_inventory(
|
|
|
|
{
|
|
|
|
"techage:sieve0", "techage:sieve1", "techage:sieve2", "techage:sieve3",
|
2022-01-03 23:40:31 +03:00
|
|
|
},
|
2020-02-15 00:59:16 +03:00
|
|
|
{
|
|
|
|
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
|
2022-09-10 17:03:42 +03:00
|
|
|
minetest.get_node_timer(pos):start(2)
|
2020-02-15 00:59:16 +03:00
|
|
|
return true
|
2019-04-30 23:45:28 +03:00
|
|
|
end
|
2022-01-03 23:40:31 +03:00
|
|
|
end,
|
2020-02-15 00:59:16 +03:00
|
|
|
listname = "src",
|
2019-04-30 23:45:28 +03:00
|
|
|
},
|
2020-02-15 00:59:16 +03:00
|
|
|
}
|
|
|
|
)
|
2021-08-16 18:57:04 +03:00
|
|
|
|
|
|
|
minecart.register_inventory(
|
|
|
|
{
|
|
|
|
"techage:ta1_mill_base",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
put = {
|
|
|
|
listname = "src",
|
|
|
|
},
|
|
|
|
take = {
|
|
|
|
listname = "dst",
|
|
|
|
},
|
|
|
|
}
|
2022-01-04 21:40:27 +03:00
|
|
|
)
|