Add hasFile checks and java misc translations

This commit is contained in:
Soggy_Pancake 2026-03-14 13:47:27 -07:00
parent 025e93b582
commit 8a2bc70c56
2 changed files with 12 additions and 2 deletions

View file

@ -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;
}

View file

@ -1,6 +1,5 @@
#pragma once
#include <cstdint>
#include "TexturePack.h"
class BufferedImage;
@ -34,8 +33,8 @@ protected:
ColourTable *m_colourTable;
protected:
BufferedImage *iconImage;
std::unique_ptr<BufferedImage> terrainAtlas, itemAtlas, bedTexCache;
private:
int textureId;