From d8ba5807784c5212012379ab06cf7236c24e4819 Mon Sep 17 00:00:00 2001 From: Maik Marschner Date: Sun, 3 Nov 2024 17:09:22 +0100 Subject: [PATCH] Fix some variants of trapdoors being rotated incorrectly. Fixes Trapsdoor are broken #1792 --- .../model/minecraft/OrientableTrapdoorModel.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/chunky/src/java/se/llbit/chunky/model/minecraft/OrientableTrapdoorModel.java b/chunky/src/java/se/llbit/chunky/model/minecraft/OrientableTrapdoorModel.java index 8df4e545b..4e7c24610 100644 --- a/chunky/src/java/se/llbit/chunky/model/minecraft/OrientableTrapdoorModel.java +++ b/chunky/src/java/se/llbit/chunky/model/minecraft/OrientableTrapdoorModel.java @@ -160,21 +160,23 @@ public OrientableTrapdoorModel(Texture texture, String half, String facing, bool if (open && half.equals("top")) { quads = Model.rotateX(Model.rotateY(quads, Math.toRadians(270)), Math.toRadians(180)); } else { - quads = Model.rotateY(quads, Math.toRadians(90)); + quads = Model.rotateY(quads, Math.toRadians(-90)); + } + } else if (facing.equals("north")) { + if (open && half.equals("top")) { + quads = Model.rotateX(Model.rotateY(quads, Math.toRadians(180)), Math.toRadians(180)); } - } else if (facing.equals("north") && open && half.equals("top")) { - quads = Model.rotateX(Model.rotateY(quads, Math.toRadians(180)), Math.toRadians(180)); } else if (facing.equals("south")) { if (half.equals("top") && open) { quads = Model.rotateX(quads, Math.toRadians(180)); } else { quads = Model.rotateY(quads, Math.toRadians(180)); } - } else { + } else { // west if (half.equals("top") && open) { - quads = Model.rotateY(Model.rotateX(quads, Math.toRadians(180)), Math.toRadians(90)); + quads = Model.rotateY(Model.rotateX(quads, Math.toRadians(180)), Math.toRadians(-90)); } else { - quads = Model.rotateY(quads, Math.toRadians(270)); + quads = Model.rotateY(quads, Math.toRadians(-270)); } }