techage_modpack/signs_bot/legacy.lua

82 lines
1.5 KiB
Lua
Raw Permalink Normal View History

2020-05-31 23:31:18 +03:00
--[[
Signs Bot
=========
2021-05-14 19:50:16 +03:00
Copyright (C) 2019-2021 Joachim Stolberg
2020-05-31 23:31:18 +03:00
GPL v3
See LICENSE.txt for more information
2022-09-24 12:01:30 +03:00
2020-05-31 23:31:18 +03:00
Registation of standard chests and furnace
]]--
-- for lazy programmers
local M = minetest.get_meta
signs_bot.register_inventory({"default:chest", "default:chest_open"}, {
put = {
listname = "main",
},
take = {
listname = "main",
},
})
signs_bot.register_inventory({"default:chest_locked", "default:chest_locked_open"}, {
put = {
allow_inventory_put = function(pos, stack, player_name)
local owner = M(pos):get_string("owner")
return owner == player_name
2022-09-24 12:01:30 +03:00
end,
2020-05-31 23:31:18 +03:00
listname = "main",
},
take = {
allow_inventory_take = function(pos, stack, player_name)
local owner = M(pos):get_string("owner")
return owner == player_name
2022-09-24 12:01:30 +03:00
end,
2020-05-31 23:31:18 +03:00
listname = "main",
},
})
signs_bot.register_inventory({"default:furnace", "default:furnace_active"}, {
put = {
allow_inventory_put = function(pos, stack, player_name)
minetest.get_node_timer(pos):start(1.0)
return true
end,
listname = "src",
},
take = {
listname = "dst",
},
fuel = {
allow_inventory_put = function(pos, stack, player_name)
minetest.get_node_timer(pos):start(1.0)
return true
end,
listname = "fuel",
},
})
2021-05-14 19:50:16 +03:00
signs_bot.register_inventory({"mobs:beehive"}, {
put = {
listname = "beehive",
},
take = {
listname = "beehive",
},
})
signs_bot.register_inventory({"xdecor:hive"}, {
put = {
listname = "honey",
},
take = {
listname = "honey",
},
})