mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-12 02:50:25 +01:00
Update snow mod to 3.2 version
This commit is contained in:
parent
618adecf2b
commit
dc1053d3f1
@ -1,5 +1,10 @@
|
|||||||
CHANGELOG:
|
CHANGELOG:
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
Version 3.2
|
||||||
|
|
||||||
|
Update compatibility to the latest minetest.
|
||||||
|
|
||||||
Version 0.3.1
|
Version 0.3.1
|
||||||
|
|
||||||
Paramat's rewrite of mapgenv6.lua: bugfixes, use noisemaps for big speed increase
|
Paramat's rewrite of mapgenv6.lua: bugfixes, use noisemaps for big speed increase
|
||||||
|
@ -128,6 +128,7 @@ snow.is_uneven = function(pos)
|
|||||||
local found
|
local found
|
||||||
local foundx
|
local foundx
|
||||||
local foundy
|
local foundy
|
||||||
|
local foundz
|
||||||
for x=-1,1 do
|
for x=-1,1 do
|
||||||
for z=-1,1 do
|
for z=-1,1 do
|
||||||
local node = get_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
local node = get_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
____) | | | | (_) \ V V / | | | | (_) | (_| |
|
____) | | | | (_) \ V V / | | | | (_) | (_| |
|
||||||
|_____/|_| |_|\___/ \_/\_/ |_| |_|\___/ \__,_|
|
|_____/|_| |_|\___/ \_/\_/ |_| |_|\___/ \__,_|
|
||||||
|
|
||||||
Version 3.1
|
Version 3.2
|
||||||
|
|
||||||
By Splizard and LazyJ.
|
By Splizard and LazyJ.
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ if snow.enable_snowfall then
|
|||||||
local get_snow = function(pos)
|
local get_snow = function(pos)
|
||||||
--Legacy support.
|
--Legacy support.
|
||||||
if weather_legacy == "snow" then
|
if weather_legacy == "snow" then
|
||||||
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
|
local perlin1 = minetest.env:get_perlin(112,3, 0.5, 150)
|
||||||
if perlin1:get2d( {x=pos.x, y=pos.z} ) > 0.53 then
|
if perlin1:get2d( {x=pos.x, y=pos.z} ) > 0.53 then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
@ -106,13 +106,13 @@ if snow.enable_snowfall then
|
|||||||
local snow_fall=function (pos, player, animate)
|
local snow_fall=function (pos, player, animate)
|
||||||
local ground_y = nil
|
local ground_y = nil
|
||||||
for y=pos.y+10,pos.y+20,1 do
|
for y=pos.y+10,pos.y+20,1 do
|
||||||
local n = minetest.get_node({x=pos.x,y=y,z=pos.z}).name
|
local n = minetest.env:get_node({x=pos.x,y=y,z=pos.z}).name
|
||||||
if n ~= "air" and n ~= "ignore" then
|
if n ~= "air" and n ~= "ignore" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for y=pos.y+10,pos.y-15,-1 do
|
for y=pos.y+10,pos.y-15,-1 do
|
||||||
local n = minetest.get_node({x=pos.x,y=y,z=pos.z}).name
|
local n = minetest.env:get_node({x=pos.x,y=y,z=pos.z}).name
|
||||||
if n ~= "air" and n ~= "ignore" then
|
if n ~= "air" and n ~= "ignore" then
|
||||||
ground_y = y
|
ground_y = y
|
||||||
break
|
break
|
||||||
@ -151,7 +151,7 @@ if snow.enable_snowfall then
|
|||||||
local smaxp = addvectors(ppos, {x= 20, y=0, z= 20})
|
local smaxp = addvectors(ppos, {x= 20, y=0, z= 20})
|
||||||
|
|
||||||
-- Make sure player is not in a cave/house...
|
-- Make sure player is not in a cave/house...
|
||||||
if get_snow(ppos) and minetest.get_node_light(ppos, 0.5) == 15 then
|
if get_snow(ppos) and minetest.env:get_node_light(ppos, 0.5) == 15 then
|
||||||
|
|
||||||
local minp = addvectors(ppos, {x=-9, y=3, z=-9})
|
local minp = addvectors(ppos, {x=-9, y=3, z=-9})
|
||||||
local maxp = addvectors(ppos, {x= 9, y=5, z= 9})
|
local maxp = addvectors(ppos, {x= 9, y=5, z= 9})
|
||||||
|
@ -68,30 +68,30 @@ local xmas_tree = {
|
|||||||
|
|
||||||
--Makes pine tree
|
--Makes pine tree
|
||||||
function snow.make_pine(pos,snow,xmas)
|
function snow.make_pine(pos,snow,xmas)
|
||||||
|
local env = minetest.env
|
||||||
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
|
local perlin1 = env:get_perlin(112,3, 0.5, 150)
|
||||||
local try_node = function(pos, node)
|
local try_node = function(pos, node)
|
||||||
local n = minetest.get_node(pos).name
|
local n = env:get_node(pos).name
|
||||||
if n == "air" or n == "ignore" then
|
if n == "air" or n == "ignore" then
|
||||||
minetest.add_node(pos,node)
|
env:add_node(pos,node)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--Clear ground.
|
--Clear ground.
|
||||||
for x=-1,1 do
|
for x=-1,1 do
|
||||||
for z=-1,1 do
|
for z=-1,1 do
|
||||||
if minetest.get_node({x=pos.x+x,y=pos.y,z=pos.z+z}).name == "default:snow" then
|
if env:get_node({x=pos.x+x,y=pos.y,z=pos.z+z}).name == "default:snow" then
|
||||||
minetest.remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
env:remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||||
end
|
end
|
||||||
if minetest.get_node({x=pos.x+x,y=pos.y,z=pos.z+z}).name == "default:snowblock" then
|
if env:get_node({x=pos.x+x,y=pos.y,z=pos.z+z}).name == "default:snowblock" then
|
||||||
minetest.remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
env:remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if xmas then
|
if xmas then
|
||||||
minetest.remove_node(pos)
|
env:remove_node(pos)
|
||||||
minetest.spawn_tree(pos, xmas_tree)
|
minetest.env:spawn_tree(pos, xmas_tree)
|
||||||
else
|
else
|
||||||
minetest.spawn_tree(pos, pine_tree)
|
minetest.env:spawn_tree(pos, pine_tree)
|
||||||
end
|
end
|
||||||
if snow then
|
if snow then
|
||||||
local x,z = pos.x,pos.z
|
local x,z = pos.x,pos.z
|
||||||
|
@ -106,7 +106,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local plain = biome == 2 -- spawns not much
|
local plain = biome == 2 -- spawns not much
|
||||||
local alpine = biome == 3 -- rocky terrain
|
local alpine = biome == 3 -- rocky terrain
|
||||||
-- Water biomes
|
-- Water biomes
|
||||||
local biome2 = pr:next(1, 5)
|
biome2 = pr:next(1, 5)
|
||||||
local cool = biome == 1 -- only spawns ice on edge of water
|
local cool = biome == 1 -- only spawns ice on edge of water
|
||||||
local icebergs = biome == 2
|
local icebergs = biome == 2
|
||||||
local icesheet = biome == 3
|
local icesheet = biome == 3
|
||||||
|
@ -66,7 +66,7 @@ end
|
|||||||
|
|
||||||
--Christmas easter egg
|
--Christmas easter egg
|
||||||
minetest.register_on_mapgen_init( function()
|
minetest.register_on_mapgen_init( function()
|
||||||
if minetest.get_modpath("skins") ~= nil then
|
if skins then
|
||||||
skins.add("character_snow_man")
|
skins.add("character_snow_man")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -53,7 +53,7 @@ than I originally planned. :p ~ LazyJ
|
|||||||
--
|
--
|
||||||
|
|
||||||
local function is_water(pos)
|
local function is_water(pos)
|
||||||
local nn = minetest:get_node(pos).name
|
local nn = minetest.env:get_node(pos).name
|
||||||
return minetest.get_item_group(nn, "water") ~= 0
|
return minetest.get_item_group(nn, "water") ~= 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ local sled = {
|
|||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
mesh = "sled.x",
|
mesh = "sled.x",
|
||||||
textures = {"sled.png"},
|
textures = {"sled.png"},
|
||||||
HUD = nil,
|
HUD,
|
||||||
|
|
||||||
driver = nil,
|
driver = nil,
|
||||||
sliding = false,
|
sliding = false,
|
||||||
@ -182,7 +182,7 @@ minetest.register_craftitem("snow:sled", {
|
|||||||
local player_pos = placer:getpos()
|
local player_pos = placer:getpos()
|
||||||
if not players_sled[name] then
|
if not players_sled[name] then
|
||||||
if minetest.get_node({x=player_pos.x,y=player_pos.y, z=player_pos.z}).name == "default:snow" then
|
if minetest.get_node({x=player_pos.x,y=player_pos.y, z=player_pos.z}).name == "default:snow" then
|
||||||
local sled = minetest:add_entity(pos, "snow:sled")
|
local sled = minetest.env:add_entity(pos, "snow:sled")
|
||||||
sled:get_luaentity():on_rightclick(placer)
|
sled:get_luaentity():on_rightclick(placer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -130,6 +130,13 @@ minetest.override_item("default:snow", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
leveled = 7,
|
||||||
|
node_box = {
|
||||||
|
type = "leveled",
|
||||||
|
fixed = {
|
||||||
|
{-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
groups = {cracky=3, crumbly=3, choppy=3, oddly_breakable_by_hand=3,falling_node=1, melts=2, float=1},
|
groups = {cracky=3, crumbly=3, choppy=3, oddly_breakable_by_hand=3,falling_node=1, melts=2, float=1},
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
--Disable placement prediction for snow.
|
--Disable placement prediction for snow.
|
||||||
|
@ -264,7 +264,7 @@ local snow_nodes = {
|
|||||||
"snow_brick",
|
"snow_brick",
|
||||||
"snow_cobble",
|
"snow_cobble",
|
||||||
}
|
}
|
||||||
local drop = nil
|
|
||||||
for _, name in pairs(snow_nodes) do
|
for _, name in pairs(snow_nodes) do
|
||||||
local nodename = "snow:"..name
|
local nodename = "snow:"..name
|
||||||
local ndef = minetest.registered_nodes[nodename]
|
local ndef = minetest.registered_nodes[nodename]
|
||||||
|
Loading…
Reference in New Issue
Block a user