-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
57 lines (52 loc) · 1.4 KB
/
init.lua
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
local time_to_sleep = tonumber(minetest.settings:get("time_to_sleep") or 0.78)
local leaf_torch = minetest.settings:get_bool("leaf_torch") ~= false
local sleeping_bag = minetest.settings:get_bool("sleeping_bag") ~= false
if leaf_torch then
minetest.register_craft({
output = "default:torch",
recipe = {
{"group:leaves"},
{"group:stick"}
}
})
end
if time_to_sleep > 1 then
minetest.settings:set("time_to_sleep", 0.78)
else
beds.day_interval.finish = time_to_sleep
end
if sleeping_bag then
local S = minetest.get_translator("easy_night")
beds.register_bed("easy_night:sleeping_bag", {
description = S("Sleeping bag"),
inventory_image = "beds_bed.png^[colorize:white:211",
wield_image = "beds_bed.png^[colorize:white:211",
tiles = {
bottom = {
"wool_white.png^[transformR270",
"wool_white.png",
"wool_white.png",
"wool_white.png",
"wool_white.png",
"wool_white.png"
},
top = {
"[combine:16x16:0,0=wool_white.png:-8,0=beds_bed_top_top.png^[transformR270",
"wool_white.png",
"wool_white.png",
"wool_white.png",
"wool_white.png",
"wool_white.png",
}
},
nodebox = {
bottom = {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.3, 1.5},
recipe = {
{"group:leaves", "group:leaves", "group:leaves"},
{"group:wood", "group:wood", "group:wood"}
}
})
end