mirror of
https://github.com/Splizard/minetest-mod-snow.git
synced 2025-06-30 07:10:21 +02:00
Version MFF.
This commit is contained in:
44
init.lua
Normal file → Executable file
44
init.lua
Normal file → Executable file
@ -47,34 +47,43 @@ http://github.com/Splizard/minetest-mod-snow/
|
||||
-- Until something else can be figured out, use paramat's "Snowdrift" mod instead.
|
||||
-- dofile(modpath.."/falling_snow.lua")
|
||||
|
||||
local load_time_start = minetest.get_us_time()
|
||||
|
||||
|
||||
-- Original init.lua File Broken into Smaller Files
|
||||
local srcpath = minetest.get_modpath"snow".."/src/"
|
||||
dofile(srcpath.."abms.lua")
|
||||
dofile(srcpath.."aliases.lua")
|
||||
dofile(srcpath.."crafting.lua")
|
||||
local modpath = minetest.get_modpath("snow")
|
||||
dofile(modpath.."/src/abms.lua")
|
||||
dofile(modpath.."/src/aliases.lua")
|
||||
dofile(modpath.."/src/crafting.lua")
|
||||
|
||||
|
||||
-- The formspec menu didn't work when util.lua was the very first "dofile" so I moved
|
||||
-- it and all the other original "dofiles", in order, to the bottom of the list. ~ LazyJ
|
||||
-- Minetest would crash if the mapgen was called upon before the rest of other snow lua files so
|
||||
-- I put it lower on the list and that seems to do the trick. ~ LazyJ
|
||||
dofile(srcpath.."util.lua")
|
||||
dofile(srcpath.."snowball.lua")
|
||||
dofile(modpath.."/src/util.lua")
|
||||
dofile(modpath.."/src/snowball.lua")
|
||||
-- To get Xmas tree saplings, the "christmas_content", true or false, in "util.lua" has to be determined first.
|
||||
-- That means "nodes.lua", where the saplings are controlled, has to come after "util.lua". ~ LazyJ
|
||||
dofile(srcpath.."nodes.lua")
|
||||
dofile(srcpath.."mapgen.lua")
|
||||
dofile(srcpath.."sled.lua")
|
||||
dofile(srcpath.."falling_snow.lua")
|
||||
dofile(modpath.."/src/nodes.lua")
|
||||
dofile(modpath.."/src/basic_stairs_slabs.lua")
|
||||
-- dofile(modpath.."/src/mapgen.lua")
|
||||
dofile(modpath.."/src/sled.lua")
|
||||
-- dofile(modpath.."/src/falling_snow.lua")
|
||||
|
||||
|
||||
|
||||
-- Check for "MoreBlocks". If not found, skip this next "dofile".
|
||||
|
||||
if rawget(_G, "stairsplus")
|
||||
and minetest.get_modpath("moreblocks") then
|
||||
|
||||
dofile(modpath.."/src/stairsplus.lua")
|
||||
|
||||
end
|
||||
|
||||
local is_uneven
|
||||
--This function places snow checking at the same time for snow level and increasing as needed.
|
||||
--This also takes into account sourrounding snow and makes snow even.
|
||||
function snow.place(pos)
|
||||
if pos.y < -19000 then return end -- Don't put anything in the nether!
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
|
||||
--Oops, maybe there is no node?
|
||||
@ -189,12 +198,3 @@ snow.register_on_configuring(function(name, v)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
local time = (minetest.get_us_time() - load_time_start) / 1000000
|
||||
local msg = "[snow] loaded after ca. " .. time .. " seconds."
|
||||
if time > 0.01 then
|
||||
print(msg)
|
||||
else
|
||||
minetest.log("info", msg)
|
||||
end
|
||||
|
Reference in New Issue
Block a user