From 322967d2d1c7cec46ce86beec59b7c0512f7fcc9 Mon Sep 17 00:00:00 2001
From: Auke Kok <sofar@foo-projects.org>
Date: Sat, 16 Jan 2016 14:53:27 -0800
Subject: [PATCH] Better trapdoor side appearance.

We're using a normal wooden side texture to draw the sides
of trapdoors. But the side textures have only 2 edges that
have a nice texture for the 2px wide trapdoor. We can
either repaint the textures, or just rotate the texture
properly for the two sides that need it.

Because the side texture for wooden doors was just a default:wood
texture, it clashes with the colors in the trapdoor, and so
we add a wooden trapdoor-matching tile side texture as well.

This also improves the steel trapdoor side, but without a
texture change there since that was already a specially
drawn texture for that node.

We also increase the thickness of the trapdoor to 2px. Right
now the model is 0.4 large, but this causes the side textures
to look odd as there's a mismatch in pixel size. By scaling the
trapdoor side up to exactly 2px, the sides look natural.

Thanks to @kilbith for the suggestion.
---
 mods/doors/README.txt                       |   4 ++--
 mods/doors/init.lua                         |  15 +++++++++------
 mods/doors/textures/doors_trapdoor_side.png | Bin 173 -> 233 bytes
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/mods/doors/README.txt b/mods/doors/README.txt
index c83720c..27f0507 100644
--- a/mods/doors/README.txt
+++ b/mods/doors/README.txt
@@ -28,7 +28,6 @@ following Textures created by BlockMen (WTFPL):
   door_obsidian_glass_side.png
 
 following textures created by celeron55 (CC BY-SA 3.0):
-  door_trapdoor_side.png
   door_glass_a.png
   door_glass_b.png
 
@@ -36,9 +35,10 @@ following Textures created by PenguinDad (CC BY-SA 4.0):
   door_glass.png
   door_obsidian_glass.png
 
-Steel trapdoor textures by sofar (CC-BY-SA-3.0)
+following textures created by sofar (CC-BY-SA-3.0)
   doors_trapdoor_steel.png
   doors_trapdoor_steel_side.png
+  door_trapdoor_side.png
 
 All other textures (created by PilzAdam): WTFPL
 
diff --git a/mods/doors/init.lua b/mods/doors/init.lua
index c8b69c4..e942d46 100644
--- a/mods/doors/init.lua
+++ b/mods/doors/init.lua
@@ -474,25 +474,28 @@ function doors.register_trapdoor(name, def)
 
 	def_closed.node_box = {
 		type = "fixed",
-		fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
+		fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5}
 	}
 	def_closed.selection_box = {
 		type = "fixed",
-		fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
+		fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5}
 	}
 	def_closed.tiles = { def.tile_front, def.tile_front, def.tile_side, def.tile_side,
 		def.tile_side, def.tile_side }
 
 	def_opened.node_box = {
 		type = "fixed",
-		fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5}
+		fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5}
 	}
 	def_opened.selection_box = {
 		type = "fixed",
-		fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5}
+		fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5}
 	}
-	def_opened.tiles = { def.tile_side, def.tile_side, def.tile_side, def.tile_side,
-		def.tile_front, def.tile_front }
+	def_opened.tiles = { def.tile_side, def.tile_side,
+			def.tile_side .. '^[transform3',
+			def.tile_side .. '^[transform1',
+			def.tile_front, def.tile_front }
+
 	def_opened.drop = name_closed
 	def_opened.groups.not_in_creative_inventory = 1
 
diff --git a/mods/doors/textures/doors_trapdoor_side.png b/mods/doors/textures/doors_trapdoor_side.png
index c86052305afb5e36c2f9376c32e88a17d4c3fee2..c45d870d90c4b50e495c4cc48911eb4e62717bc2 100644
GIT binary patch
delta 216
zcmZ3>_>ysgWIYoD1H*)g8D>C=Ey>&6h2cL4F4((#GEjuGz$3Dlfq`2Xgc%uT&5-~K
zvX^-Jy0SlD6cAT8+B0dUEKsP-)5S4F<NVu6hJ4Ki0xZ`BPwaDkmr=nf|G@Z4O_Q0w
zt6=#y9Rt=Sjcl({PF?id{>--Ihms;=LinS=rj{+got_qJ^j_Y>kdbA#-jvB;wP>%}
z^B(m*A12g)&~B9c{q5P$8EZ0hI{xN$+J<s6#J=-=qpDJ*y74|k*<tO|vIjSs0G+_#
M>FVdQ&MBb@0IC{L+5i9m

delta 156
zcmV;N0Av5@0j&X$8Gi!+001a04^sdD01{A4R7G1yDPT)1h-o*Gb40R>Qvd(|BfmNs
z00011Nkl<ZcmYk!0Sd$*6a&$5e(rzfHE6qiAS8-mZP3HXZrMmIvQ24<#vD`VnoCDv
z9X!ip|L9!2B?tLZ>9bcewLUQ0nunapyfBq}Ig&Y&Au+5!S`~gw%L0M$`QR=90000<
KMNUMnLSTY~!ac$O