-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
89 lines (70 loc) · 2.02 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
82
83
84
85
86
87
88
89
-- Fun_tools init.lua
-- Copyright Duane Robertson ([email protected]), 2017, 2019
-- Distributed under the LGPLv2.1 (https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)
fun_tools = {}
local mod = fun_tools
local mod_name = 'fun_tools'
mod.version = '20190726'
mod.path = minetest.get_modpath(minetest.get_current_modname())
mod.world = minetest.get_worldpath()
mod.creative = minetest.setting_getbool('creative_mode')
mod.environ_mod = 'mapgen'
mod.fast_load = minetest.setting_getbool('fun_tools_fast_load')
mod.ice_fuel_source = 'default:coalblock'
mod.precision_tool = 'default:diamond'
mod.remove_bronze = minetest.setting_getbool('fun_tools_remove_bronze')
mod.torchlight = minetest.setting_getbool('fun_tools_torchlight')
-- These all default to enabled... because I say.
for _, k in pairs({'fast_load', 'remove_bronze', 'torchlight', }) do
if mod[k] == nil then
mod[k] = true
end
end
function mod.clone_node(name)
if not (name and type(name) == 'string') then
return
end
local node = minetest.registered_nodes[name]
local node2 = table.copy(node)
return node2
end
function mod.use_inventory_items(user, items)
if not (user and items) then
return
end
local inv = user:get_inventory()
if not inv then
return
end
for _, item in pairs(items) do
if not inv:contains_item('main', item) then
return
end
end
for _, item in pairs(items) do
inv:remove_item('main', item)
end
return true
end
--dofile(mod.path .. '/recipe_list.lua')
dofile(mod.path .. '/beds.lua')
dofile(mod.path .. '/bombs.lua')
dofile(mod.path .. '/game.lua')
dofile(mod.path .. '/guns.lua')
dofile(mod.path .. '/lighting.lua')
dofile(mod.path .. '/misc.lua')
dofile(mod.path .. '/paint.lua')
dofile(mod.path .. '/power_tools.lua')
dofile(mod.path .. '/rope.lua')
dofile(mod.path .. '/travel.lua')
dofile(mod.path .. '/wallhammer.lua')
--mod.print_recipes()
--[[
minetest.register_lbm({
name = mod_name..':flare_killer',
nodenames = { mod_name..':flare_air' },
action = function(pos, node)
minetest.remove_node(pos)
end,
})
--]]