minetest-dayblock/init.lua

49 lines
1.2 KiB
Lua
Raw Normal View History

2012-07-01 10:19:25 -07:00
-- TIME OF DAY BLOCK MOD
-- by whiskers75
2012-07-01 10:49:44 -07:00
local version = "1.1"
2012-07-01 10:19:25 -07:00
minetest.register_node ("dayblock:block", {
drawtype = blocklike,
description = "Day Block",
tile_images = {"day.png"},
inventory_image = {"day.png"},
sunlight_propagates = true,
paramtype = 'light',
walkable = true,
groups = {dig_immediate=2},
material = minetest.digprop_constanttime(1.0),
})
minetest.register_on_punchnode(function(pos, node, puncher)
if node.name == "dayblock:block" then
minetest.env:set_timeofday(0.5)
minetest.chat_send_all("Midday set by dayblock")
end
end)
2012-07-01 10:49:44 -07:00
minetest.register_node ("dayblock:nblock", {
drawtype = blocklike,
description = "Night Block",
tile_images = {"night.png"},
inventory_image = {"night.png"},
sunlight_propagates = true,
paramtype = 'light',
walkable = true,
groups = {dig_immediate=2},
material = minetest.digprop_constanttime(1.0),
})
minetest.register_on_punchnode(function(pos, node, puncher)
if node.name == "dayblock:nblock" then
minetest.env:set_timeofday(0)
minetest.chat_send_all("Midnight set by nightblock")
end
end)
2012-07-01 10:19:25 -07:00
print("Dayblock Mod version "..version.." loaded!")