improved resource generation error handling

This commit is contained in:
octarine-noise
2014-07-06 20:10:05 +02:00
parent 7a02179481
commit 25b1d76c9e
4 changed files with 23 additions and 16 deletions

View File

@@ -32,19 +32,16 @@ import cpw.mods.fml.relauncher.SideOnly;
public class LeafTextureGenerator extends BlockTextureGenerator implements IIconRegister {
public LeafTextureGenerator() {
super("bf_leaves_autogen", new ResourceLocation("betterfoliage", "textures/blocks/missingleaf.png"));
super("bf_leaves_autogen", new ResourceLocation("betterfoliage", "textures/blocks/missing_leaf.png"));
}
/** List of helpers which can identify leaf textures loaded by alternate means */
public List<ILeafTextureRecognizer> recognizers = Lists.newLinkedList();
public IResource getResource(ResourceLocation resourceLocation) throws IOException {
LeafTextureResource result = new LeafTextureResource(unwrapResource(resourceLocation));
if (result.data != null) {
counter++;
return result;
}
return getMissingResource();
LeafTextureResource result = new LeafTextureResource(unwrapResource(resourceLocation), getMissingResource());
if (result.data != null) counter++;
return result;
}
/** Leaf blocks register their textures here. An extra texture will be registered in the atlas