forked from minetest-mirrors/ethereal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
177 lines (133 loc) · 4.34 KB
/
init.lua
File metadata and controls
177 lines (133 loc) · 4.34 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
--[[
Minetest Ethereal Mod
Created by ChinChow
Updated by TenPlus1
]]
-- global
ethereal = {version = "20260206"}
-- setting helper
local function setting(stype, name, default)
local value
if stype == "bool" then
value = core.settings:get_bool("ethereal." .. name)
elseif stype == "string" then
value = core.settings:get("ethereal." .. name)
elseif stype == "number" then
value = tonumber(core.settings:get("ethereal." .. name))
end
if value == nil then value = default end
ethereal[name] = value
end
-- DO NOT change settings below, use the settings.conf file instead
setting("number", "leaftype", 0)
setting("bool", "leafwalk", false)
setting("bool", "cavedirt", true)
setting("bool", "torchdrop", true)
setting("bool", "papyruswalk", true)
setting("bool", "lilywalk", true)
setting("bool", "xcraft", true)
setting("bool", "flight", true)
setting("number", "glacier", 1)
setting("number", "bamboo", 1)
setting("number", "mesa", 1)
setting("number", "alpine", 1)--taiga
setting("number", "snowy", 1)--coniferous_forest
setting("number", "frost", 1)
setting("number", "grassy", 1)--deciduous_forest
setting("number", "caves", 1)
setting("number", "grayness", 1)
setting("number", "grassytwo", 1)
setting("number", "prairie", 1)
setting("number", "jumble", 1)
setting("number", "junglee", 1)--rainforest
setting("number", "desert", 1)
setting("number", "grove", 1)
setting("number", "mushroom", 1)
setting("number", "sandstone", 1)--sandstone_desert
setting("number", "plains", 1)
setting("number", "savanna", 1)
setting("number", "fiery", 1)
setting("number", "swamp", 1)
setting("number", "quicksand", 1)--swamp quicksand
setting("number", "tundra", 1)
setting("number", "mediterranean", 1)
setting("number", "cold_desert", 1)
setting("number", "snowy_grassland", 1)
setting("number", "mangrove", 1)
setting("number", "magical_forest", 1)
setting("number", "sealife", 1)
setting("number", "reefs", 1)
setting("number", "logs", 1)
setting("bool", "wood_rotate", true)
local path = core.get_modpath("ethereal")
--[[ Load settings.conf file if found [DEPRECATED]
local input = io.open(path.."/settings.conf", "r")
if input then
dofile(path .. "/settings.conf") ; input:close() ; input = nil
end ]]
-- Falling node function
ethereal.check_falling = core.check_for_falling or nodeupdate
-- creative check
local creative_mode_cache = core.settings:get_bool("creative_mode")
function ethereal.check_creative(name)
return creative_mode_cache or core.check_player_privs(name, {creative = true})
end
-- helper function to add {eatable} group to food items
function ethereal.add_eatable(item, hp, ftype)
local def = core.registered_items[item]
if def then
local groups = table.copy(def.groups) or {}
groups.eatable = hp ; groups.flammable = 2 ; groups.food = ftype or 2
core.override_item(item, {groups = groups})
end
end
-- strawberry check and load
if core.get_modpath("farming") and farming.mod and farming.mod == "redo" then
-- farming redo already has strawberry included
else
dofile(path .. "/strawberry.lua")
end
-- load mod sections
dofile(path .. "/plantlife.lua")
dofile(path .. "/onion.lua")
dofile(path .. "/crystal.lua")
dofile(path .. "/water.lua")
dofile(path .. "/dirt.lua")
dofile(path .. "/food.lua")
dofile(path .. "/wood.lua")
dofile(path .. "/leaves.lua")
dofile(path .. "/sapling.lua")
dofile(path .. "/fishing.lua")
dofile(path .. "/extra.lua")
dofile(path .. "/sealife.lua")
dofile(path .. "/fences.lua")
if core.settings:get_bool("ethereal.clear_default_biomes", true) then
dofile(path .. "/biomes_init.lua")
end
dofile(path .. "/biomes.lua")
dofile(path .. "/ores.lua")
dofile(path .. "/schems.lua")
dofile(path .. "/decor.lua")
dofile(path .. "/compatibility.lua")
dofile(path .. "/stairs.lua")
-- add flight if enabled
if ethereal.flight then
dofile(path .. "/flight.lua")
end
-- add lucky blocks if mod active
if core.get_modpath("lucky_block") then
dofile(path .. "/lucky_block.lua")
end
-- Set bonemeal aliases
if core.get_modpath("bonemeal") then
core.register_alias("ethereal:bone", "bonemeal:bone")
core.register_alias("ethereal:bonemeal", "bonemeal:bonemeal")
else -- or return to where it came from
core.register_alias("ethereal:bone", "default:dirt")
core.register_alias("ethereal:bonemeal", "default:dirt")
end
-- ambience lite
if core.get_modpath("ambience") then
dofile(path .. "/ambience.lua")
end
print ("[MOD] Ethereal loaded")