From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.Client/ChestRenderer.cpp | 49 ++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'Minecraft.Client/ChestRenderer.cpp') diff --git a/Minecraft.Client/ChestRenderer.cpp b/Minecraft.Client/ChestRenderer.cpp index d1b5cf91..97954b55 100644 --- a/Minecraft.Client/ChestRenderer.cpp +++ b/Minecraft.Client/ChestRenderer.cpp @@ -5,11 +5,29 @@ #include "ModelPart.h" #include "..\Minecraft.World\net.minecraft.world.level.tile.entity.h" #include "..\Minecraft.World\net.minecraft.world.level.tile.h" +#include "..\Minecraft.World\Calendar.h" -ChestRenderer::ChestRenderer() +ResourceLocation ChestRenderer::CHEST_LARGE_TRAP_LOCATION = ResourceLocation(TN_TILE_LARGE_TRAP_CHEST); +//ResourceLocation ChestRenderer::CHEST_LARGE_XMAS_LOCATION = ResourceLocation(TN_TILE_LARGE_XMAS_CHEST); +ResourceLocation ChestRenderer::CHEST_LARGE_LOCATION = ResourceLocation(TN_TILE_LARGE_CHEST); +ResourceLocation ChestRenderer::CHEST_TRAP_LOCATION = ResourceLocation(TN_TILE_TRAP_CHEST); +//ResourceLocation ChestRenderer::CHEST_XMAS_LOCATION = ResourceLocation(TN_TILE_XMAS_CHEST); +ResourceLocation ChestRenderer::CHEST_LOCATION = ResourceLocation(TN_TILE_CHEST); + +ChestRenderer::ChestRenderer() : TileEntityRenderer() { chestModel = new ChestModel(); largeChestModel = new LargeChestModel(); + + xmasTextures = false; + + // 4J Stu - Disable this +#if 0 + if (Calendar::GetMonth() + 1 == 12 && Calendar::GetDayOfMonth() >= 24 && Calendar::GetDayOfMonth() <= 26) + { + xmasTextures = true; + } +#endif } ChestRenderer::~ChestRenderer() @@ -34,7 +52,7 @@ void ChestRenderer::render(shared_ptr _chest, double x, double y, d Tile *tile = chest->getTile(); data = chest->getData(); - if (tile != NULL && data == 0) + if (dynamic_cast(tile) != NULL && data == 0) { ((ChestTile *) tile)->recalcLockDir(chest->getLevel(), chest->x, chest->y, chest->z); data = chest->getData(); @@ -49,12 +67,35 @@ void ChestRenderer::render(shared_ptr _chest, double x, double y, d if (chest->e.lock() != NULL || chest->s.lock() != NULL) { model = largeChestModel; - bindTexture(TN_TILE_LARGE_CHEST); // 4J Was "/item/largechest.png" + + if (chest->getType() == ChestTile::TYPE_TRAP) + { + bindTexture(&CHEST_LARGE_TRAP_LOCATION); + } + //else if (xmasTextures) + //{ + // bindTexture(&CHEST_LARGE_XMAS_LOCATION); + //} + else + { + bindTexture(&CHEST_LARGE_LOCATION); + } } else { model = chestModel; - bindTexture(TN_TILE_CHEST); // 4J Was "/item/chest.png" + if (chest->getType() == ChestTile::TYPE_TRAP) + { + bindTexture(&CHEST_TRAP_LOCATION); + } + //else if (xmasTextures) + //{ + // bindTexture(&CHEST_XMAS_LOCATION); + //} + else + { + bindTexture(&CHEST_LOCATION); + } } glPushMatrix(); -- cgit v1.2.3