From 681c2950fd20974557f0da2bd9002a6643f193a7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Dec 2017 13:07:24 +0100 Subject: [PATCH] Fix mirrored trapdoor top/bottom texture when open --- mods/ITEMS/mcl_doors/api_trapdoors.lua | 26 ++++++++++++++++++++++++-- mods/ITEMS/mcl_doors/register.lua | 6 ++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_doors/api_trapdoors.lua b/mods/ITEMS/mcl_doors/api_trapdoors.lua index 6c3e9bcbc2..b1dc47900b 100644 --- a/mods/ITEMS/mcl_doors/api_trapdoors.lua +++ b/mods/ITEMS/mcl_doors/api_trapdoors.lua @@ -74,6 +74,18 @@ function mcl_doors:register_trapdoor(name, def) -- Closed trapdoor + local tile_front = def.tile_front + local tile_side = def.tile_side + if not tile_side then + tile_side = tile_front + end + local tiles_closed = { + tile_front, + tile_front .. "^[transformFY", + tile_side .. "^[transform6", tile_side .. "^[transform6", + tile_side .. "^[transform6", tile_side .. "^[transform6", + } + local groups_closed = groups groups_closed.trapdoor = 1 minetest.register_node(name, { @@ -81,7 +93,7 @@ function mcl_doors:register_trapdoor(name, def) _doc_items_longdesc = longdesc, _doc_items_usagehelp = usagehelp, drawtype = "nodebox", - tiles = def.tiles, + tiles = tiles_closed, inventory_image = def.inventory_image, wield_image = def.wield_image, is_ground_content = false, @@ -134,10 +146,20 @@ function mcl_doors:register_trapdoor(name, def) -- Open trapdoor local groups_open = table.copy(groups) + + local tiles_open = { + tile_side, + tile_side .. "^[transformR180", + tile_side .. "^[transformR270", + tile_side .. "^[transformR90", + tile_front .. "^[transform46", + tile_front .. "^[transformFY", + } + groups_open.trapdoor = 2 minetest.register_node(name.."_open", { drawtype = "nodebox", - tiles = def.tiles, + tiles = tiles_open, is_ground_content = false, paramtype = "light", paramtype2 = "facedir", diff --git a/mods/ITEMS/mcl_doors/register.lua b/mods/ITEMS/mcl_doors/register.lua index ed3f43b770..9d04d5d941 100644 --- a/mods/ITEMS/mcl_doors/register.lua +++ b/mods/ITEMS/mcl_doors/register.lua @@ -217,7 +217,8 @@ for w=1, #woods do description = woods[w][2], _doc_items_longdesc = "Wooden trapdoors are horizontal barriers which can be opened and closed by hand or a redstone signal. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.", _doc_items_usagehelp = "To open or close the trapdoor, rightclick it or send a redstone signal to it.", - tiles = {woods[w][3]}, + tile_front = woods[w][3], + tile_side = woods[w][3], wield_image = woods[w][3], groups = {handy=1,axey=1, mesecon_effector_on=1, material_wood=1}, _mcl_hardness = 3, @@ -243,7 +244,8 @@ end mcl_doors:register_trapdoor("mcl_doors:iron_trapdoor", { description = "Iron Trapdoor", _doc_items_longdesc = "Iron trapdoors are horizontal barriers which can only be opened and closed by redstone signals, but not by hand. They occupy the upper or lower part of a block, depending on how they have been placed. When open, they can be climbed like a ladder.", - tiles = {"doors_trapdoor_steel.png"}, + tile_front = "doors_trapdoor_steel.png", + tile_side = "doors_trapdoor_steel.png", wield_image = "doors_trapdoor_steel.png", groups = {pickaxey=1, mesecon_effector_on=1}, _mcl_hardness = 5,