-
Notifications
You must be signed in to change notification settings - Fork 7
/
init.lua
150 lines (130 loc) · 3.6 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
paleotest = {}
paleotest.mobkit_mobs = {}
paleotest.global_walkable = {}
paleotest.global_flora = {}
paleotest.global_leaves = {}
paleotest.global_plants = {}
paleotest.global_liquid = {}
minetest.register_on_mods_loaded(function()
-- Entities
for name in pairs(minetest.registered_entities) do
local mob = minetest.registered_entities[name]
if mob.get_staticdata == mobkit.statfunc
and (mob.logic or mob.brainfunc) then
table.insert(paleotest.mobkit_mobs, name)
end
end
-- Nodes
for name in pairs(minetest.registered_nodes) do
if name ~= "air" and name ~= "ignore" then
if minetest.registered_nodes[name].walkable then
table.insert(paleotest.global_walkable, name)
end
if minetest.registered_nodes[name].groups.flora then
table.insert(paleotest.global_flora, name)
table.insert(paleotest.global_plants, name)
end
if minetest.registered_nodes[name].groups.leaves then
table.insert(paleotest.global_leaves, name)
table.insert(paleotest.global_plants, name)
end
if minetest.registered_nodes[name].drawtype == "liquid" then
table.insert(paleotest.global_liquid, name)
end
end
end
end)
paleotest.global_meat = {}
local common_meat_names = {
"beef",
"chicken",
"mutton",
"porkchop",
"meat"
}
minetest.register_on_mods_loaded(function()
for name in pairs(minetest.registered_items) do
for _,i in ipairs(common_meat_names) do
if (name:match(i)
and (name:match("raw") or name:match("uncooked")))
or minetest.registered_items[name].groups.food_meat_raw then
table.insert(paleotest.global_meat, name)
end
end
end
end)
paleotest.global_fish = {}
local common_fish_names = {
"fish",
"cod",
"bass",
"tuna",
"salmon"
}
minetest.register_on_mods_loaded(function()
for name in pairs(minetest.registered_items) do
for _, i in ipairs(common_fish_names) do
if name:find(i)
and (name:find("raw")
or name:find("uncooked"))
or name:find("cooked") then
table.insert(paleotest.global_fish, name)
end
end
end
end)
function paleotest.remove_string(tbl, val)
for i, v in ipairs(tbl) do
if v == val then
return table.remove(tbl, i)
end
end
end
function paleotest.find_string(tbl, val)
for _, v in ipairs(tbl) do
if v == val then
return true
end
end
return false
end
local path = minetest.get_modpath("paleotest")
-- API
dofile(path.."/api/api.lua")
dofile(path.."/api/hq_lq.lua")
dofile(path.."/api/register.lua")
if minetest.settings:get_bool("legacy_convert") then
dofile(path.."/legacy_convert.lua")
end
-- Items
dofile(path.."/nodes.lua")
dofile(path.."/craftitems.lua")
dofile(path.."/crafting.lua")
dofile(path.."/ores.lua")
dofile(path.."/fossil_analyzer.lua")
dofile(path.."/dna_cultivator.lua")
dofile(path.."/feeders.lua")
-- Dinosaurs
dofile(path.."/mobs/brachiosaurus.lua")
dofile(path.."/mobs/carnotaurus.lua")
dofile(path.."/mobs/stegosaurus.lua")
dofile(path.."/mobs/spinosaurus.lua")
dofile(path.."/mobs/triceratops.lua")
dofile(path.."/mobs/tyrannosaurus.lua")
dofile(path.."/mobs/velociraptor.lua")
-- Reptiles
dofile(path.."/mobs/pteranodon.lua")
dofile(path.."/mobs/quetzalcoatlus.lua")
dofile(path.."/mobs/sarcosuchus.lua")
-- Aquatic Mobs
dofile(path.."/mobs/dunkleosteus.lua")
dofile(path.."/mobs/mosasaurus.lua")
dofile(path.."/mobs/plesiosaurus.lua")
-- Mammals
dofile(path.."/mobs/dire_wolf.lua")
dofile(path.."/mobs/elasmotherium.lua")
dofile(path.."/mobs/mammoth.lua")
dofile(path.."/mobs/procoptodon.lua")
dofile(path.."/mobs/smilodon.lua")
dofile(path.."/mobs/thylacoleo.lua")
minetest.log("action", "[MOD] PaleoTest v2.0 Dev loaded")