Initial commit (split off from calendar mod)

master
Wuzzy 2020-08-28 16:14:59 +02:00
commit 0091df6eac
5 changed files with 63 additions and 0 deletions

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# Calendar Node
This mod adds a placable and craftable calendar.
(See the crafting guide to see how to craft it).
Provided you have the `calendar` mod, you can use the calendar to view
the current date in the HUD.
See the `calendar` mod to learn more about the calendar system.
If the `calendar` mod is not found, the placable calendar is basically just
a decorative block.

48
init.lua Normal file
View File

@ -0,0 +1,48 @@
local S = minetest.get_translator("calendar_node")
local on_rightclick
if minetest.get_modpath("calendar") then
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 the calendar mod was not found, the calendar node is basically
-- just a decorative node.
end
minetest.register_node("calendar_node:calendar", {
drawtype = "signlike",
description = S("Calendar"),
tiles = { "calendar_node_calendar.png" },
inventory_image = "calendar_node_calendar.png",
wield_image = "calendar_node_calendar.png",
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = false,
walkable = false,
groups = { dig_immediate = 3, attached_node = 1, },
selection_box = {
type = "wallmounted",
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", S("Calendar"))
end,
on_rightclick = on_rightclick,
})
if minetest.get_modpath("default") and minetest.get_modpath("dye") then
minetest.register_craft({
output = "calendar_node:calendar",
recipe = {
{ "default:paper","default:paper","default:paper" },
{ "default:paper","dye:black","default:paper" },
{ "default:paper","default:paper","default:paper" },
},
})
end

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = calendar_node
description = Adds a placable calendar
optional_depends = calendar, default, dye

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B