From fe3e837e1be767d1935c0774153892eec58ff555 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 | 71 +++++++++++++----- .../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, 53 insertions(+), 18 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 8326822a..df097b47 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -1,6 +1,41 @@ local S = minetest.get_translator("mcl_chests") 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 = { @@ -221,12 +256,12 @@ local chest_update_after_close = function(pos) minetest.swap_node(pos, {name="mcl_chests:trapped_chest_small", param2 = node.param2}) if animate_chests then - find_or_create_entity(pos, "mcl_chests:trapped_chest_small", {"mcl_chests_trapped.png"}, node.param2, false, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_small") + find_or_create_entity(pos, "mcl_chests:trapped_chest_small", tiles_chest_trapped_small, node.param2, false, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_small") end 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") @@ -238,7 +273,7 @@ local chest_update_after_close = function(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 @@ -849,8 +884,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"}, @@ -865,8 +900,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"}, @@ -892,7 +927,7 @@ register_chest("trapped_chest", function(pos, node, clicker) minetest.swap_node(pos, {name="mcl_chests:trapped_chest_on_small", param2 = node.param2}) if animate_chests then - find_or_create_entity(pos, "mcl_chests:trapped_chest_on_small", {"mcl_chests_trapped.png"}, node.param2, false, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_small") + find_or_create_entity(pos, "mcl_chests:trapped_chest_on_small", tiles_chest_trapped_small, node.param2, false, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_on_small") end mesecon.receptor_on(pos, trapped_chest_mesecons_rules) end, @@ -901,7 +936,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") @@ -915,7 +950,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 ) @@ -937,14 +972,14 @@ local function close_if_trapped_chest(pos, player) if node.name == "mcl_chests:trapped_chest_on_small" then minetest.swap_node(pos, {name="mcl_chests:trapped_chest_small", param2 = node.param2}) if animate_chests then - find_or_create_entity(pos, "mcl_chests:trapped_chest_small", {"mcl_chests_trapped.png"}, node.param2, false, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_small") + find_or_create_entity(pos, "mcl_chests:trapped_chest_small", tiles_chest_trapped_small, node.param2, false, "default_chest", "mcl_chests_chest", "chest"):reinitialize("mcl_chests:trapped_chest_small") end mesecon.receptor_off(pos, trapped_chest_mesecons_rules) 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") @@ -958,7 +993,7 @@ local function close_if_trapped_chest(pos, player) 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) @@ -1006,7 +1041,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", @@ -1059,8 +1094,8 @@ minetest.register_node("mcl_chests:ender_chest_small", { type = "fixed", fixed = {-0.4375, -0.5, -0.4375, 0.4375, 0.375, 0.4375}, }, - tiles = animate_chests and {"mcl_chests_blank.png"} or {"mcl_chests_ender.png"}, - _chest_entity_textures = {"mcl_chests_ender.png"}, + tiles = animate_chests and {"mcl_chests_blank.png"} or tiles_chest_ender_small, + _chest_entity_textures = tiles_chest_ender_small, _chest_entity_sound = "mcl_chests_enderchest", _chest_entity_mesh = "mcl_chests_chest", _chest_entity_animation_type = "chest", @@ -1082,11 +1117,11 @@ minetest.register_node("mcl_chests:ender_chest_small", { meta:set_string("formspec", formspec_ender_chest) if animate_chests then - create_entity(pos, "mcl_chests:ender_chest_small", {"mcl_chests_ender.png"}, minetest.get_node(pos).param2, false, "mcl_chests_enderchest", "mcl_chests_chest", "chest") + create_entity(pos, "mcl_chests:ender_chest_small", tiles_chest_ender_small, minetest.get_node(pos).param2, false, "mcl_chests_enderchest", "mcl_chests_chest", "chest") end end, on_rightclick = function(pos, node, clicker) - player_chest_open(clicker, pos, "mcl_chests:ender_chest_small", {"mcl_chests_ender.png"}, node.param2, false, "mcl_chests_enderchest", "mcl_chests_chest") + player_chest_open(clicker, pos, "mcl_chests:ender_chest_small", tiles_chest_ender_small, node.param2, false, "mcl_chests_enderchest", "mcl_chests_chest") end, on_receive_fields = function(pos, formname, fields, sender) if fields.quit then 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 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|ei2$Dv*Tez_Ee0(IQHL1Qw95$RxHfYh{y5d1bzJkhNcS_E)*$*1qErb zC$Xsn#KrL~a*ByL6&n*1dSHsM9IKatLn>>4Lx7{DNQ3B<$%`9`%me%x(*m3s-<@d6 zI_foX#Q|O2RyVE%4xCIqy}hR!CA!TU85vmoDnvM%4lD>@@C_HykcfyE;L5r)k=3_n z;ljksl?hUZn1c=0PWZEI+BBAvHn 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 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|ei2$Dv*Tez_Ee3{F3=9pTqGuQw z-fL>Uy~6P4rT-SYx-URAj3q&S!3+-1ZlnP@n>}3|Lp+YZoqU$}kO7Zd@#8aGb{iT5 zxlIfh(-`WCo;~|on8WP4ME8PH*A?~1`AU0DdMCF?&Tn>b(P{0_5zR6v?#u0wd0e$J za4W|Q$%q0g*0PWX{w@Fh8_fA|Cu{l74K-PY_e9KI{!l&W$jlJ2YJ+cPL%>#!&u27P z_J`ZH+<&)d_0_ZOPp41JnC>^r?9vXut>3qKu~(N@aEty~%+S5%`j(5eORu*&^|)2s gsa(h}Ed2i%>-vo28$?zf0r{7~)78&qol`;+02_UBCIA2c 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 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|ei2$Dv*Te!KOG{KVQNgR-By~yA z{PUNupMUr6&C^?H3P2ggk|4ie28U-i(tw;To-U3d9>KZsjLAG0gjd;4Wd&fFK#F@5AbJ93vgz9ccLll zsMo|52Xu8?-MAJwa5DAu_MUE(=r(U;WMJ{D5aDP#upofJH(W$RA|hUZE9=fgR^Oh5 z3llR}CP*D(4mMaj;m@*Z(^yWHdlhi4VaQssabskZ(Tuha0%n5i8MsX|L>By#@wVt` e3N*OFz)-j4?A_hFR*3=K&*16m=d#Wzp$Pz8q+#y> literal 0 HcmV?d00001