mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
Update snow mod to 3.2 version
This commit is contained in:
parent
618adecf2b
commit
dc1053d3f1
@ -1,5 +1,10 @@
|
||||
CHANGELOG:
|
||||
------------
|
||||
|
||||
Version 3.2
|
||||
|
||||
Update compatibility to the latest minetest.
|
||||
|
||||
Version 0.3.1
|
||||
|
||||
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 foundx
|
||||
local foundy
|
||||
local foundz
|
||||
for x=-1,1 do
|
||||
for z=-1,1 do
|
||||
local node = get_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||
|
@ -5,7 +5,7 @@
|
||||
____) | | | | (_) \ V V / | | | | (_) | (_| |
|
||||
|_____/|_| |_|\___/ \_/\_/ |_| |_|\___/ \__,_|
|
||||
|
||||
Version 3.1
|
||||
Version 3.2
|
||||
|
||||
By Splizard and LazyJ.
|
||||
|
||||
|
@ -79,7 +79,7 @@ if snow.enable_snowfall then
|
||||
local get_snow = function(pos)
|
||||
--Legacy support.
|
||||
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
|
||||
return true
|
||||
else
|
||||
@ -106,13 +106,13 @@ if snow.enable_snowfall then
|
||||
local snow_fall=function (pos, player, animate)
|
||||
local ground_y = nil
|
||||
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
|
||||
return
|
||||
end
|
||||
end
|
||||
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
|
||||
ground_y = y
|
||||
break
|
||||
@ -151,7 +151,7 @@ if snow.enable_snowfall then
|
||||
local smaxp = addvectors(ppos, {x= 20, y=0, z= 20})
|
||||
|
||||
-- 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 maxp = addvectors(ppos, {x= 9, y=5, z= 9})
|
||||
|
@ -68,30 +68,30 @@ local xmas_tree = {
|
||||
|
||||
--Makes pine tree
|
||||
function snow.make_pine(pos,snow,xmas)
|
||||
|
||||
local perlin1 = minetest.get_perlin(112,3, 0.5, 150)
|
||||
local env = minetest.env
|
||||
local perlin1 = env:get_perlin(112,3, 0.5, 150)
|
||||
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
|
||||
minetest.add_node(pos,node)
|
||||
env:add_node(pos,node)
|
||||
end
|
||||
end
|
||||
--Clear ground.
|
||||
for x=-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
|
||||
minetest.remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||
if env:get_node({x=pos.x+x,y=pos.y,z=pos.z+z}).name == "default:snow" then
|
||||
env:remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||
end
|
||||
if minetest.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})
|
||||
if env:get_node({x=pos.x+x,y=pos.y,z=pos.z+z}).name == "default:snowblock" then
|
||||
env:remove_node({x=pos.x+x,y=pos.y,z=pos.z+z})
|
||||
end
|
||||
end
|
||||
end
|
||||
if xmas then
|
||||
minetest.remove_node(pos)
|
||||
minetest.spawn_tree(pos, xmas_tree)
|
||||
env:remove_node(pos)
|
||||
minetest.env:spawn_tree(pos, xmas_tree)
|
||||
else
|
||||
minetest.spawn_tree(pos, pine_tree)
|
||||
minetest.env:spawn_tree(pos, pine_tree)
|
||||
end
|
||||
if snow then
|
||||
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 alpine = biome == 3 -- rocky terrain
|
||||
-- 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 icebergs = biome == 2
|
||||
local icesheet = biome == 3
|
||||
|
@ -66,7 +66,7 @@ end
|
||||
|
||||
--Christmas easter egg
|
||||
minetest.register_on_mapgen_init( function()
|
||||
if minetest.get_modpath("skins") ~= nil then
|
||||
if skins then
|
||||
skins.add("character_snow_man")
|
||||
end
|
||||
end
|
||||
|
@ -53,7 +53,7 @@ than I originally planned. :p ~ LazyJ
|
||||
--
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
@ -68,7 +68,7 @@ local sled = {
|
||||
visual = "mesh",
|
||||
mesh = "sled.x",
|
||||
textures = {"sled.png"},
|
||||
HUD = nil,
|
||||
HUD,
|
||||
|
||||
driver = nil,
|
||||
sliding = false,
|
||||
@ -182,7 +182,7 @@ minetest.register_craftitem("snow:sled", {
|
||||
local player_pos = placer:getpos()
|
||||
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
|
||||
local sled = minetest:add_entity(pos, "snow:sled")
|
||||
local sled = minetest.env:add_entity(pos, "snow:sled")
|
||||
sled:get_luaentity():on_rightclick(placer)
|
||||
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},
|
||||
sunlight_propagates = true,
|
||||
--Disable placement prediction for snow.
|
||||
|
@ -264,7 +264,7 @@ local snow_nodes = {
|
||||
"snow_brick",
|
||||
"snow_cobble",
|
||||
}
|
||||
local drop = nil
|
||||
|
||||
for _, name in pairs(snow_nodes) do
|
||||
local nodename = "snow:"..name
|
||||
local ndef = minetest.registered_nodes[nodename]
|
||||
|
Loading…
Reference in New Issue
Block a user