commit 0091df6eacec1ec975dd64e12b072560e6812de7 Author: Wuzzy Date: Fri Aug 28 16:14:59 2020 +0200 Initial commit (split off from calendar mod) diff --git a/README.md b/README.md new file mode 100644 index 0000000..f3b05b9 --- /dev/null +++ b/README.md @@ -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. diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..544d2f5 --- /dev/null +++ b/init.lua @@ -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 diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..8c8f052 --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = calendar_node +description = Adds a placable calendar +optional_depends = calendar, default, dye diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..a15d66f Binary files /dev/null and b/screenshot.png differ diff --git a/textures/calendar_node_calendar.png b/textures/calendar_node_calendar.png new file mode 100644 index 0000000..ab780fb Binary files /dev/null and b/textures/calendar_node_calendar.png differ