-
Notifications
You must be signed in to change notification settings - Fork 6
/
me.lua
70 lines (57 loc) · 1.45 KB
/
me.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
local me = {}
me.name = "bzfoundry"
function me.basic_founding()
return mods.bztin or mods.bzaluminum
end
function me.woodcoke()
return me.get_setting("bzfoundry-woodcoke")
end
function me.founding_plates()
return me.get_setting("bzfoundry-plates") == "yes"
end
function me.smelt()
return me.get_setting("bzfoundry-smelt")
end
function me.enable()
return not me.get_setting("bzfoundry-minimal")
end
function me.carbon()
if me.get_setting("bz-all-intermediates") then return "coke" end
return me.get_setting("bzfoundry-hydrocarbon")
end
function me.carbonrecipe()
local carbon = me.carbon()
if carbon == "coke" then
return "coke"
elseif carbon == "solid-fuel" then
return "solid-fuel-from-coal"
end
return nil
end
function me.get_other_machines()
local machines = {}
if me.get_setting(me.name.."-other-machines") then
for machine in string.gmatch(me.get_setting(me.name.."-other-machines"), '[^",%s]+') do
table.insert(machines, machine)
end
end
return machines
end
function me.get_setting(name)
if settings.startup[name] == nil then
return nil
end
return settings.startup[name].value
end
me.bypass = {}
if me.get_setting(me.name.."-recipe-bypass") then
for recipe in string.gmatch(me.get_setting(me.name.."-recipe-bypass"), '[^",%s]+') do
me.bypass[recipe] = true
end
end
function me.add_modified(name)
if me.get_setting(me.name.."-list") then
table.insert(me.list, name)
end
end
return me