forked from mtcontrib/minetest-mod-snow
Corrige des erreurs de syntaxe
This commit is contained in:
parent
221c440034
commit
8f34ce940b
2
init.lua
2
init.lua
@ -51,7 +51,7 @@ local load_time_start = minetest.get_us_time()
|
|||||||
|
|
||||||
|
|
||||||
-- Original init.lua File Broken into Smaller Files
|
-- Original init.lua File Broken into Smaller Files
|
||||||
local srcpath = minetest.get_modpath"snow".."/src/"
|
local srcpath = minetest.get_modpath("snow").."/src/"
|
||||||
dofile(srcpath.."abms.lua")
|
dofile(srcpath.."abms.lua")
|
||||||
dofile(srcpath.."aliases.lua")
|
dofile(srcpath.."aliases.lua")
|
||||||
dofile(srcpath.."crafting.lua")
|
dofile(srcpath.."crafting.lua")
|
||||||
|
@ -57,7 +57,7 @@ of snowblocks (and then use them to water-grief by melting the snow blocks).
|
|||||||
|
|
||||||
~ LazyJ
|
~ LazyJ
|
||||||
|
|
||||||
--]]
|
]]
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
|
@ -11,7 +11,7 @@ saplings grow into trees. --]]
|
|||||||
|
|
||||||
|
|
||||||
-- Part 1: To disable the mapgen, add the *starting* comment under this line.
|
-- Part 1: To disable the mapgen, add the *starting* comment under this line.
|
||||||
|
--[[
|
||||||
local perlin_scale, nosmooth_rarity
|
local perlin_scale, nosmooth_rarity
|
||||||
if not snow.disable_mapgen then
|
if not snow.disable_mapgen then
|
||||||
print("[snow] Mapgen enabled!")
|
print("[snow] Mapgen enabled!")
|
||||||
@ -60,11 +60,11 @@ if not snow.disable_mapgen then
|
|||||||
|
|
||||||
|
|
||||||
--Identify the mapgen.
|
--Identify the mapgen.
|
||||||
local mgname = minetest.get_mapgen_setting"mg_name"
|
local mgname = minetest.get_mapgen_setting("mg_name")
|
||||||
if not mgname then
|
if not mgname then
|
||||||
minetest.log("error", "[MOD] Snow Biomes: WARNING! mapgen could not be identifyed!")
|
minetest.log("error", "[MOD] Snow Biomes: WARNING! mapgen could not be identifyed!")
|
||||||
end
|
end
|
||||||
local path = minetest.get_modpath"snow"
|
local path = minetest.get_modpath("snow")
|
||||||
if mgname == "v7" then
|
if mgname == "v7" then
|
||||||
--Load mapgen_v7 compatibility.
|
--Load mapgen_v7 compatibility.
|
||||||
dofile(path.."/src/mapgen_v7.lua")
|
dofile(path.."/src/mapgen_v7.lua")
|
||||||
@ -75,7 +75,7 @@ if not snow.disable_mapgen then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- To complete the commenting-out add the *closing* comment under this line.
|
-- To complete the commenting-out add the *closing* comment under this line.
|
||||||
|
]]
|
||||||
|
|
||||||
local pine_tree = {
|
local pine_tree = {
|
||||||
axiom="TABff",
|
axiom="TABff",
|
||||||
@ -202,7 +202,7 @@ function snow.voxelmanip_pine(pos,a,data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- treecapitator support
|
-- treecapitator support
|
||||||
if minetest.global_exists"treecapitator" then
|
if minetest.global_exists("treecapitator") then
|
||||||
treecapitator.register_tree{
|
treecapitator.register_tree{
|
||||||
trees = {"default:pine_tree"},
|
trees = {"default:pine_tree"},
|
||||||
leaves = {"snow:needles"},
|
leaves = {"snow:needles"},
|
||||||
|
@ -67,9 +67,9 @@ end)
|
|||||||
|
|
||||||
|
|
||||||
-- Christmas egg
|
-- Christmas egg
|
||||||
if minetest.global_exists"skins" then
|
if minetest.global_exists("skins") then
|
||||||
skins.add"character_snow_man"
|
skins.add("character_snow_man")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Decorated Pine Leaves
|
-- Decorated Pine Leaves
|
||||||
@ -271,7 +271,7 @@ if not snow.disable_mapgen then
|
|||||||
default.register_leafdecay{
|
default.register_leafdecay{
|
||||||
trunks = {"default:tree"},
|
trunks = {"default:tree"},
|
||||||
leaves = {"snow:apple", "snow:leaves"},
|
leaves = {"snow:apple", "snow:leaves"},
|
||||||
radius = minetest.get_mapgen_setting"mg_name" == "v6" and 2 or 3,
|
radius = minetest.get_mapgen_setting("mg_name") == "v6" and 2 or 3,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
-- Quite a bit of trial-and-error learning here and it boiled down to a
|
-- Quite a bit of trial-and-error learning here and it boiled down to a
|
||||||
-- small handful of code lines making the difference. ~ LazyJ
|
-- small handful of code lines making the difference. ~ LazyJ
|
||||||
|
|
||||||
local creative_mode = minetest.settings:get_bool"creative_mode"
|
local creative_mode = minetest.settings:get_bool("creative_mode")
|
||||||
|
|
||||||
|
|
||||||
local snowball_velocity, entity_attack_delay
|
local snowball_velocity, entity_attack_delay
|
||||||
local function update_snowball_vel(v)
|
local function update_snowball_vel(v)
|
||||||
snowball_velocity = v
|
snowball_velocity = v
|
||||||
local walkspeed = tonumber(minetest.settings:get"movement_speed_walk") or 4
|
local walkspeed = tonumber(minetest.settings:get("movement_speed_walk")) or 4
|
||||||
entity_attack_delay = (walkspeed+1)/v
|
entity_attack_delay = (walkspeed+1)/v
|
||||||
end
|
end
|
||||||
update_snowball_vel(snow.snowball_velocity)
|
update_snowball_vel(snow.snowball_velocity)
|
||||||
@ -27,7 +27,7 @@ snow.register_on_configuring(function(name, v)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local function get_gravity()
|
local function get_gravity()
|
||||||
local grav = tonumber(minetest.settings:get"movement_gravity") or 9.81
|
local grav = tonumber(minetest.settings:get("movement_gravity")) or 9.81
|
||||||
return grav*snowball_gravity
|
return grav*snowball_gravity
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user