use of buildcraft.lib.client.model.json.JsonTexture in project BuildCraft by BuildCraft.
the class ModelHolderVariable method lookupTexture.
private TexturedFace lookupTexture(String lookup) {
int attempts = 0;
JsonTexture texture = new JsonTexture(lookup);
TextureAtlasSprite sprite;
while (texture.location.startsWith("#") && attempts < 10) {
JsonTexture tex = rawModel.textures.get(texture.location);
if (tex == null)
break;
else
texture = texture.inParent(tex);
attempts++;
}
lookup = texture.location;
if (lookup.startsWith("~")) {
sprite = customSprites.get(lookup.substring(1));
if (sprite == null) {
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite();
}
} else {
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(lookup);
}
TexturedFace face = new TexturedFace();
face.sprite = sprite;
face.faceData = texture.faceData;
return face;
}
Aggregations