From ff384c9588c956b3d3eacefa6950fa5e26069ed0 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 11 Dec 2021 17:16:10 +0100 Subject: [PATCH] Reskin chests as presents on December 24th to 26th --- mods/ITEMS/mcl_chests/init.lua | 57 ++++++++++++++---- .../textures/mcl_chests_ender_present.png | Bin 0 -> 286 bytes .../mcl_chests_normal_double_present.png | Bin 0 -> 307 bytes .../textures/mcl_chests_normal_present.png | Bin 0 -> 285 bytes .../mcl_chests_trapped_double_present.png | Bin 0 -> 307 bytes .../textures/mcl_chests_trapped_present.png | Bin 0 -> 286 bytes 6 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 mods/ITEMS/mcl_chests/textures/mcl_chests_ender_present.png create mode 100644 mods/ITEMS/mcl_chests/textures/mcl_chests_normal_double_present.png create mode 100644 mods/ITEMS/mcl_chests/textures/mcl_chests_normal_present.png create mode 100644 mods/ITEMS/mcl_chests/textures/mcl_chests_trapped_double_present.png create mode 100644 mods/ITEMS/mcl_chests/textures/mcl_chests_trapped_present.png diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 35712dfd1..0dd5358bd 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -1,6 +1,41 @@ local S = minetest.get_translator(minetest.get_current_modname()) local mod_doc = minetest.get_modpath("doc") +-- Christmas chest setup +local it_is_christmas = false +local date = os.date("*t") +if ( + date.month == 12 and ( + date.day == 24 or + date.day == 25 or + date.day == 26 + ) +) then + it_is_christmas = true +end + +local tiles_chest_normal_small = {"mcl_chests_normal.png"} +local tiles_chest_normal_double = {"mcl_chests_normal_double.png"} + +if it_is_christmas then + tiles_chest_normal_small = {"mcl_chests_normal_present.png"} + tiles_chest_normal_double = {"mcl_chests_normal_double_present.png"} +end + +local tiles_chest_trapped_small = {"mcl_chests_trapped.png"} +local tiles_chest_trapped_double = {"mcl_chests_trapped_double.png"} + +if it_is_christmas then + tiles_chest_trapped_small = {"mcl_chests_trapped_present.png"} + tiles_chest_trapped_double = {"mcl_chests_trapped_double_present.png"} +end + +local tiles_chest_ender_small = {"mcl_chests_ender.png"} + +if it_is_christmas then + tiles_chest_ender_small = {"mcl_chests_ender_present.png"} +end + -- Chest Entity local animate_chests = (minetest.settings:get_bool("animated_chests") ~= false) local entity_animations = { @@ -212,7 +247,7 @@ local function chest_update_after_close(pos) mesecon.receptor_off(pos, trapped_chest_mesecons_rules) elseif node.name == "mcl_chests:trapped_chest_on_left" then minetest.swap_node(pos, {name="mcl_chests:trapped_chest_left", param2 = node.param2}) - find_or_create_entity(pos, "mcl_chests:trapped_chest_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") + find_or_create_entity(pos, "mcl_chests:trapped_chest_left", tiles_chest_trapped_double, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") mesecon.receptor_off(pos, trapped_chest_mesecons_rules) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") @@ -224,7 +259,7 @@ local function chest_update_after_close(pos) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") minetest.swap_node(pos_other, {name="mcl_chests:trapped_chest_left", param2 = node.param2}) - find_or_create_entity(pos_other, "mcl_chests:trapped_chest_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") + find_or_create_entity(pos_other, "mcl_chests:trapped_chest_left", tiles_chest_trapped_double, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") mesecon.receptor_off(pos_other, trapped_chest_mesecons_rules) end end @@ -805,8 +840,8 @@ register_chest("chest", chestusage, S("27 inventory slots") .. "\n" .. S("Can be combined to a large chest"), { - small = {"mcl_chests_normal.png"}, - double = {"mcl_chests_normal_double.png"}, + small = tiles_chest_normal_small, + double = tiles_chest_normal_double, inv = {"default_chest_top.png", "mcl_chests_chest_bottom.png", "mcl_chests_chest_right.png", "mcl_chests_chest_left.png", "mcl_chests_chest_back.png", "default_chest_front.png"}, @@ -821,8 +856,8 @@ register_chest("chest", ) local traptiles = { - small = {"mcl_chests_trapped.png"}, - double = {"mcl_chests_trapped_double.png"}, + small = tiles_chest_trapped_small, + double = tiles_chest_trapped_double, inv = {"mcl_chests_chest_trapped_top.png", "mcl_chests_chest_trapped_bottom.png", "mcl_chests_chest_trapped_right.png", "mcl_chests_chest_trapped_left.png", "mcl_chests_chest_trapped_back.png", "mcl_chests_chest_trapped_front.png"}, @@ -855,7 +890,7 @@ register_chest("trapped_chest", meta:set_int("players", 1) minetest.swap_node(pos, {name="mcl_chests:trapped_chest_on_left", param2 = node.param2}) - find_or_create_entity(pos, "mcl_chests:trapped_chest_on_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_left") + find_or_create_entity(pos, "mcl_chests:trapped_chest_on_left", tiles_chest_trapped_double, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_left") mesecon.receptor_on(pos, trapped_chest_mesecons_rules) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") @@ -869,7 +904,7 @@ register_chest("trapped_chest", mesecon.receptor_on(pos, trapped_chest_mesecons_rules) minetest.swap_node(pos_other, {name="mcl_chests:trapped_chest_on_left", param2 = node.param2}) - find_or_create_entity(pos_other, "mcl_chests:trapped_chest_on_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_left") + find_or_create_entity(pos_other, "mcl_chests:trapped_chest_on_left", tiles_chest_trapped_double, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_left") mesecon.receptor_on(pos_other, trapped_chest_mesecons_rules) end ) @@ -896,7 +931,7 @@ register_chest("trapped_chest_on", player_chest_close(player) elseif node.name == "mcl_chests:trapped_chest_on_left" then minetest.swap_node(pos, {name="mcl_chests:trapped_chest_left", param2 = node.param2}) - find_or_create_entity(pos, "mcl_chests:trapped_chest_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") + find_or_create_entity(pos, "mcl_chests:trapped_chest_left", tiles_chest_trapped_double, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") mesecon.receptor_off(pos, trapped_chest_mesecons_rules) local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "left") @@ -910,7 +945,7 @@ register_chest("trapped_chest_on", local pos_other = mcl_util.get_double_container_neighbor_pos(pos, node.param2, "right") minetest.swap_node(pos_other, {name="mcl_chests:trapped_chest_left", param2 = node.param2}) - find_or_create_entity(pos_other, "mcl_chests:trapped_chest_left", {"mcl_chests_trapped_double.png"}, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") + find_or_create_entity(pos_other, "mcl_chests:trapped_chest_left", tiles_chest_trapped_double, node.param2, true, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_left") mesecon.receptor_off(pos_other, trapped_chest_mesecons_rules) player_chest_close(player) @@ -958,7 +993,7 @@ minetest.register_node("mcl_chests:ender_chest", { _doc_items_usagehelp = S("Rightclick the ender chest to access your personal interdimensional inventory."), drawtype = "mesh", mesh = "mcl_chests_chest.obj", - tiles = {"mcl_chests_ender.png"}, + tiles = tiles_chest_ender_small, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false, paramtype = "light", paramtype2 = "facedir", diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_ender_present.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_ender_present.png new file mode 100644 index 0000000000000000000000000000000000000000..85df1bfba0c5d08e3224ffb8dfef2128592962b2 GIT binary patch literal 286 zcmV+(0pb3MP)H{ z04hKgKwLFubx?b)f2j3&0Q|2$0<|oD00001bW%=J06^y0W&i*Hv`IukR7l5TU@tFV z0D{oa&~hMFQc@}hVg@8oUS1BOLR?(RU0hsMz?2gn1xg@5Wd%?`P(e8qfEARJqkwWZ zP)`A7P(uOk$bxFcN|C6*EiHvc3ZOs<0*sA~%Yhh+H-P~F1WtGq2!g<%PykI=6et*2 zUl0mv+>r%MjG>`nX{lfu!UIz*ytN?1Lv9VcNGMI+&5H=C701Gu} k6rlPXOE`>zQ83g10DiR1-MhM~761SM07*qoM6N<$f*aajQUCw| literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_normal_double_present.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_normal_double_present.png new file mode 100644 index 0000000000000000000000000000000000000000..55139fcb2fb79e1ca5872fdb7a3df233b0be263a GIT binary patch literal 307 zcmV-30nGl1P)Hn z9|RjT1k3;c?(R9M69l}iqS zFc5~j@B&_;CLX{>-MaX1V7LG#asU&0eUVQ3vLF@$80Xu}FpIA((}&pLA{w*-6r}+a zMGpX8p}x1kglZprmKg%+vvL73T7ZZ^fH?%q|AX}jhHqse|1j0UM2tl002ovPDHLk FV1ifUc7^}| literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_normal_present.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_normal_present.png new file mode 100644 index 0000000000000000000000000000000000000000..23faf46b890e0a2f10f34f4db01f1e4807673d50 GIT binary patch literal 285 zcmV+&0pk9NP)H{ z006200Du)0%m4uIDJkvL0Q~7sv_5|H00001bW%=J06^y0W&i*Hvq?ljR7l6|lg$mn zFbqa>7sZq5Em>F1bIt6xA;7^49|1g~J+-j%!uzYGU-V`?J_$9$X0{~d6uuW-z zP_+p2%qRrES3QK^?xL&J&4=Zek!Y7rnl{q7PPO;8N(Xy)cncN$qX3Jv*R;`nrPqZ* jj7E6ed7%#z6aU5quV}}x6sg4R00000NkvXXu0mjf8+~#n literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_trapped_double_present.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_trapped_double_present.png new file mode 100644 index 0000000000000000000000000000000000000000..2d10331f32669d2eb7e6d375fc8d594c164fb3d6 GIT binary patch literal 307 zcmV-30nGl1P)H+ z3IISA03b?-G-af(R9M69l}iqS zFc5~j@B&_;CLX{>-MaX1V7LG#asU&0eUVQ3vLF@$80Xu}FpIA((}&pLA{w*-6r}+a zMGpX8p}x1kglZprmKg%+vvL73T7ZZ^fH?%q|AX}jhHqse|1j0UM2tl002ovPDHLk FV1kmecgg?& literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_trapped_present.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_trapped_present.png new file mode 100644 index 0000000000000000000000000000000000000000..473f24c573614c7b5c7bfb886255dd197ac6c312 GIT binary patch literal 286 zcmV+(0pb3MP)Hd z04fy~VIWF}G-af6pU>0R&+hK*<=SQ-00001bW%=J06^y0W&i*Hv`IukR7l5TU@tFV z0D{oa&~hMFQc@}hVg@8oUS1BOLR?(RU0hsMz?2gn1xg@5Wd%?`P(e8qfEARJqkwWZ zP)`A7P(uOk$bxFcN|C6*EiHvc3ZOs<0*sA~%Yhh+H-P~F1WtGq2!g<%PykI=6et*2 zUl0mv+>r%MjG>`nX{lfu!UIz*ytN?1Lv9VcNGMI+&5H=C701Gu} k6rlPXOE`>zQ83g10DiR1-MhM~761SM07*qoM6N<$f?cFx?*IS* literal 0 HcmV?d00001