forked from Lokrates/Biofuel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
biofuel.lua
127 lines (97 loc) · 2.73 KB
/
biofuel.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
-- Load support for MT game translation.
local S = minetest.get_translator("biofuel")
--Biofuel:
----------
--Vial of Biofuel
minetest.register_craftitem("biofuel:phial_fuel", {
description = S("Vial of Biofuel"),
inventory_image = "biofuel_phial_fuel.png"
})
minetest.register_craft({
type = "fuel",
recipe = "biofuel:phial_fuel",
burntime = 10,
})
minetest.register_craft({
output = "biofuel:phial_fuel 4",
recipe = {{"biofuel:bottle_fuel"}}
})
--Bottle of Biofuel
minetest.register_craftitem("biofuel:bottle_fuel", {
description = S("Bottle of Biofuel"),
inventory_image = "biofuel_bottle_fuel.png",
groups = {biofuel = 1}
})
minetest.register_craft({
type = "shapeless",
output = "biofuel:bottle_fuel",
recipe = {"biofuel:phial_fuel", "biofuel:phial_fuel", "biofuel:phial_fuel", "biofuel:phial_fuel"}
})
minetest.register_craft({
type = "fuel",
recipe = "biofuel:bottle_fuel",
burntime = 40,
})
minetest.register_craft({
type = "shapeless",
output = "biofuel:bottle_fuel 9",
recipe = {"biofuel:fuel_can"}
})
--Canister of Biofuel
minetest.register_craftitem("biofuel:fuel_can", {
description = S("Canister of Biofuel"),
inventory_image = "biofuel_fuel_can.png"
})
minetest.register_craft({
type = "fuel",
recipe = "biofuel:fuel_can",
burntime = 370,
})
minetest.register_craft({
output = "biofuel:fuel_can",
recipe = {
{"group:biofuel", "group:biofuel", "group:biofuel"},
{"group:biofuel", "group:biofuel", "group:biofuel"},
{"group:biofuel", "group:biofuel", "group:biofuel"}
}
})
--Mod compatibility:
--------------------
local register_biofuel = function(name, burntime)
if not minetest.registered_items[name] then
return;
end
local groups = table.copy(minetest.registered_items[name].groups)
groups.biofuel = 1
minetest.override_item(name, { groups = groups })
if burntime and burntime >= 0 then
minetest.register_craft({
type = "fuel",
recipe = name,
burntime = burntime,
})
end
end
--Wine
register_biofuel("wine:bottle_rum", 40)
register_biofuel("wine:bottle_tequila", 40)
register_biofuel("wine:bottle_bourbon", 40)
register_biofuel("wine:bottle_sake", 40)
register_biofuel("wine:bottle_vodka", 40)
--Cucina_Vegana
register_biofuel("cucina_vegana:sunflower_seeds_oil")
register_biofuel("cucina_vegana:flax_seed_oil")
register_biofuel("cucina_vegana:lettuce_oil")
register_biofuel("cucina_vegana:peanut_oil")
--Farming_Redo
register_biofuel("farming:bottle_ethanol")
register_biofuel("farming:hemp_oil")
--Basic Materials
register_biofuel("basic_materials:oil_extract")
if minetest.get_modpath("basic_materials") then
minetest.register_craft({
type = "shapeless",
output = "basic_materials:oil_extract 2",
recipe = {"biofuel:bottle_fuel", "biofuel:bottle_fuel"}
})
end