minetest_calendar/node.lua

42 lines
1.1 KiB
Lua
Raw Normal View History

local S = calendar._get_translator("calendar")
2020-08-27 14:08:58 -07:00
minetest.register_node("calendar:calendar", {
drawtype = "signlike",
description = S("Calendar"),
tiles = { "calendar_calendar.png" },
inventory_image = "calendar_calendar.png",
wield_image = "calendar_calendar.png",
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = false,
walkable = false,
2020-08-28 06:09:31 -07:00
groups = { dig_immediate = 3, attached_node = 1, },
2020-08-27 14:08:58 -07:00
selection_box = {
type = "wallmounted",
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Calendar"))
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then
return itemstack
end
calendar.show_calendar(clicker:get_player_name())
return itemstack
end,
})
if minetest.get_modpath("default") and minetest.get_modpath("dye") then
minetest.register_craft({
output = "calendar:calendar",
recipe = {
{ "default:paper","default:paper","default:paper" },
{ "default:paper","dye:black","default:paper" },
{ "default:paper","default:paper","default:paper" },
},
})
end