From 8a2bc70c5675335ef8a5de6413729aebd2e8e327 Mon Sep 17 00:00:00 2001 From: Soggy_Pancake <54160598+Soggy-Pancake@users.noreply.github.com> Date: Sat, 14 Mar 2026 13:47:27 -0700 Subject: [PATCH] Add hasFile checks and java misc translations --- Minecraft.Client/AbstractTexturePack.cpp | 11 +++++++++++ Minecraft.Client/AbstractTexturePack.h | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/AbstractTexturePack.cpp b/Minecraft.Client/AbstractTexturePack.cpp index fed4ea7b..53261ebe 100644 --- a/Minecraft.Client/AbstractTexturePack.cpp +++ b/Minecraft.Client/AbstractTexturePack.cpp @@ -388,8 +388,19 @@ void AbstractTexturePack::load(Textures *textures) bool AbstractTexturePack::hasFile(const wstring &name, bool allowFallback) { + if (name == L"res/terrain.png" && terrainAtlas != nullptr) + return true; + + if (name == L"res/items.png" && itemAtlas != nullptr) + return true; + bool hasFile = this->hasFile(name); + auto it = INDEXED_TO_JAVA_MAP.find(name); + if (it != INDEXED_TO_JAVA_MAP.end()) { + hasFile = this->hasFile(L"assets/minecraft/textures/" + it->second); + } + return !hasFile && (allowFallback && fallback != NULL) ? fallback->hasFile(name, allowFallback) : hasFile; } diff --git a/Minecraft.Client/AbstractTexturePack.h b/Minecraft.Client/AbstractTexturePack.h index 5fb39d86..1b5e89e2 100644 --- a/Minecraft.Client/AbstractTexturePack.h +++ b/Minecraft.Client/AbstractTexturePack.h @@ -1,6 +1,5 @@ #pragma once #include - #include "TexturePack.h" class BufferedImage; @@ -34,8 +33,8 @@ protected: ColourTable *m_colourTable; -protected: BufferedImage *iconImage; + std::unique_ptr terrainAtlas, itemAtlas, bedTexCache; private: int textureId;