-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
81 lines (72 loc) · 2.66 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
compression.compressed_nodes = {
"default:clay",
"default:desert_stone",
"default:desert_sand",
"default:stone",
"default:sand",
"default:silver_sand",
"default:dry_dirt",
"default:gravel",
"default:ice",
"default:permafrost",
"default:obsidian",
"default:snowblock",
"default:coalblock",
"wool:white",
}
local moreblocks_available = minetest.get_modpath("moreblocks")
local max_compression_level = tonumber(minetest.settings:get("max_compression_level") or 10)
local maxlvl = tonumber(core.settings:get("max_compression_level") or 10)
compression.register_compressed_nodes(compression.compressed_nodes, maxlvl)
local mod = ""
local moreblocks_stone_output = ""
local moreblocks_desert_stone_output = ""
if moreblocks_available then
compression.register_compressed_tiers("moreblocks:cobble_compressed", maxlvl)
compression.register_compressed_tiers("moreblocks:desert_cobble_compressed", maxlvl)
compression.register_compressed_tiers("moreblocks:dirt_compressed", maxlvl)
if max_compression_level > 0 then
moreblocks_stone_output, moreblocks_desert_stone_output = "compression:default_stone_compressed_level_1", "compression:default_desert_stone_compressed_level_1"
else
moreblocks_stone_output, moreblocks_desert_stone_output = "default:stone 9", "default:desert_stone 9"
end
minetest.register_craft({
type = "cooking",
recipe = "moreblocks:cobble_compressed",
output = moreblocks_stone_output,
cooktime = 9,
})
minetest.register_craft({
type = "cooking",
recipe = "moreblocks:desert_cobble_compressed",
output = moreblocks_desert_stone_output,
cooktime = 9,
})
mod = "moreblocks"
else
compression.register_compressed_tiers("default:cobble", maxlvl)
compression.register_compressed_tiers("default:desert_cobble", maxlvl)
compression.register_compressed_tiers("default:dirt", maxlvl)
mod = "default"
end
for level = 1, max_compression_level, 1 do
minetest.register_craft({
type = "cooking",
recipe = "compression:" .. mod .. "_cobble_compressed_level_" .. level,
output = "compression:default_stone_compressed_level_" .. level,
cooktime = 3 ^ level,
})
minetest.register_craft({
type = "cooking",
recipe = "compression:" .. mod .. "_desert_cobble_compressed_level_" .. level,
output = "compression:default_desert_stone_compressed_level_" .. level,
cooktime = 3 ^ level,
})
if level < 8 then
minetest.register_craft({
type = "fuel",
recipe = "compression:default_coalblock_compressed_level_" .. level,
burntime = 370 * (9 ^ level),
})
end
end