mirror of
https://github.com/SmallJoker/bitchange.git
synced 2024-11-14 23:00:18 +01:00
Add new configuration loading
This commit is contained in:
parent
525a89c653
commit
f846f5624c
22
init.lua
22
init.lua
|
@ -1,11 +1,29 @@
|
|||
--Created by Krock for the BitChange mod
|
||||
local mod_path = minetest.get_modpath("bitchange")
|
||||
local world_path = minetest.get_worldpath()
|
||||
|
||||
if freeminer then
|
||||
minetest = freeminer
|
||||
end
|
||||
|
||||
dofile(mod_path.."/config.txt")
|
||||
dofile(mod_path.."/config.default.txt")
|
||||
-- Copied from moretrees mod
|
||||
if io.open(world_path.."/bitchange_config.txt","r") == nil then
|
||||
io.input(mod_path.."/config.default.txt")
|
||||
io.output(world_path.."/bitchange_config.txt")
|
||||
|
||||
while true do
|
||||
local block = io.read(256) -- 256B at once
|
||||
if not block then
|
||||
io.close()
|
||||
break
|
||||
end
|
||||
io.write(block)
|
||||
end
|
||||
else
|
||||
dofile(world_path.."/bitchange_config.txt")
|
||||
end
|
||||
|
||||
dofile(mod_path.."/minecoins.lua")
|
||||
if(bitchange_use_moreores_tin or bitchange_use_technic_zinc or bitchange_use_gold) then
|
||||
dofile(mod_path.."/moreores.lua")
|
||||
|
@ -52,4 +70,4 @@ function bitchange_has_access(owner, player_name)
|
|||
return (player_name == owner or minetest.get_player_privs(player_name).server or minetest.get_player_privs(player_name).bitchange)
|
||||
end
|
||||
|
||||
print("[BitChange] Loaded.")
|
||||
print("[BitChange] Loaded.")
|
||||
|
|
Loading…
Reference in New Issue
Block a user