mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-07-26 09:47:09 +00:00
Add hasFile checks and java misc translations
This commit is contained in:
parent
025e93b582
commit
8a2bc70c56
|
|
@ -388,8 +388,19 @@ void AbstractTexturePack::load(Textures *textures)
|
||||||
|
|
||||||
bool AbstractTexturePack::hasFile(const wstring &name, bool allowFallback)
|
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);
|
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;
|
return !hasFile && (allowFallback && fallback != NULL) ? fallback->hasFile(name, allowFallback) : hasFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "TexturePack.h"
|
#include "TexturePack.h"
|
||||||
|
|
||||||
class BufferedImage;
|
class BufferedImage;
|
||||||
|
|
@ -34,8 +33,8 @@ protected:
|
||||||
|
|
||||||
ColourTable *m_colourTable;
|
ColourTable *m_colourTable;
|
||||||
|
|
||||||
protected:
|
|
||||||
BufferedImage *iconImage;
|
BufferedImage *iconImage;
|
||||||
|
std::unique_ptr<BufferedImage> terrainAtlas, itemAtlas, bedTexCache;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int textureId;
|
int textureId;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue