aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/ChestRenderer.cpp
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/ChestRenderer.cpp
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (diff)
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 <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/ChestRenderer.cpp')
-rw-r--r--Minecraft.Client/ChestRenderer.cpp49
1 files changed, 45 insertions, 4 deletions
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<TileEntity> _chest, double x, double y, d
Tile *tile = chest->getTile();
data = chest->getData();
- if (tile != NULL && data == 0)
+ if (dynamic_cast<ChestTile*>(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<TileEntity> _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();