From 562f9902765c45ad198f1af402229120e69cbbf7 Mon Sep 17 00:00:00 2001 From: Whiskers75 - Date: Mon, 2 Jul 2012 08:32:22 +0100 Subject: [PATCH] Added crafting recipes --- init.lua | 17 ++++++++++++++- init.lua~ | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 init.lua~ diff --git a/init.lua b/init.lua index a085525..c7cacb9 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,7 @@ -- TIME OF DAY BLOCK MOD -- by whiskers75 -local version = "1.1" +local version = "1.2" minetest.register_node ("dayblock:block", { drawtype = blocklike, @@ -23,6 +23,21 @@ minetest.register_on_punchnode(function(pos, node, puncher) end end) +minetest.register_craft({ + output = '"dayblock:block" 4', + recipe = { + {'"default:glass"', '', '"default:mese"'}, + } +}) + + +minetest.register_craft({ + output = '"dayblock:nblock" 4', + recipe = { + {'"default:glass"', 'default:dirt', '"default:mese"'}, + } +}) + minetest.register_node ("dayblock:nblock", { diff --git a/init.lua~ b/init.lua~ new file mode 100644 index 0000000..abd667d --- /dev/null +++ b/init.lua~ @@ -0,0 +1,63 @@ +-- TIME OF DAY BLOCK MOD +-- by whiskers75 + +local version = "1.1" + +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) + +minetest.register_craft({ + output = '"dayblock:block" 4', + recipe = { + {'"default:glass"', '', '"default:mese"'}, + } +}) + + +minetest.register_craft({ + output = '"dayblock:nblock" 4', + recipe = { + {'"default:glass"', 'default:dirt', '"default:mese"'}, + } +}) + + + +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) + +print("Dayblock Mod version "..version.." loaded!")