first commit. snow expands.

master
Izzy 2016-07-13 21:14:36 -07:00
commit 6b05344b54
5 changed files with 115 additions and 0 deletions

41
.gitignore vendored Normal file
View File

@ -0,0 +1,41 @@
# Compiled Lua sources
luac.out
# luarocks build files
*.src.rock
*.zip
*.tar.gz
# Object files
*.o
*.os
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

13
LICENSE.md Normal file
View File

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Izzy
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

11
README.md Normal file
View File

@ -0,0 +1,11 @@
Winter Is Coming
=========
Snow biomes expand and envelope the entire map. Existing resources are transformed.
Copyright 2016 Izzy
WTFPL. Do what the fuck you want.

1
depends.txt Normal file
View File

@ -0,0 +1 @@
default

49
init.lua Normal file
View File

@ -0,0 +1,49 @@
local modpath = minetest.get_modpath("winter_is_coming")
local modname = "winter_is_coming"
minetest.register_abm({
nodenames = { "default:snow" },
interval = 1,
chance = 5,
action = function(pos, node, active_object_count, active_object_count_wider)
local n = minetest.find_node_near(pos, 2, {"default:dirt_with_grass"})
if n == nil then
return
end
minetest.set_node(n, {name="default:dirt_with_snow"})
n.y = n.y + 1
local q = minetest.get_node(n)
if q == nil then
return
end
if minetest.get_item_group(q.name, "flora") > 0 then
minetest.set_node(n, {name="default:dry_shrub"})
end
end,
})
minetest.register_abm({
nodenames = { "default:dirt_with_snow" },
interval = 1,
chance = 10,
action = function(pos, node, active_object_count, active_object_count_wider)
local n = minetest.find_node_near(pos, 1, {"default:dirt_with_snow"})
if n ~= nil then
n.y = n.y + 1
local q = minetest.get_node(n)
if q ~= nil and (q.name == "air" or q.name == "default:grass") then
minetest.set_node(n, {name="default:snow"})
end
end
end,
})