forked from joe7575/signs_bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlegacy.lua
More file actions
81 lines (69 loc) · 1.45 KB
/
legacy.lua
File metadata and controls
81 lines (69 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
--[[
Signs Bot
=========
Copyright (C) 2019-2021 Joachim Stolberg
GPL v3
See LICENSE.txt for more information
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
end,
listname = "main",
},
take = {
allow_inventory_take = function(pos, stack, player_name)
local owner = M(pos):get_string("owner")
return owner == player_name
end,
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",
},
})
signs_bot.register_inventory({"mobs:beehive"}, {
put = {
listname = "beehive",
},
take = {
listname = "beehive",
},
})
signs_bot.register_inventory({"xdecor:hive"}, {
put = {
listname = "honey",
},
take = {
listname = "honey",
},
})