Fix strange npe in facade item renderer

This commit is contained in:
Prototik 2014-08-29 15:27:01 +08:00
parent 79bba8834f
commit fb6a30a06c

View file

@ -156,21 +156,20 @@ public class FacadeItemRenderer implements IItemRenderer {
}
private IIcon tryGetBlockIcon(Block block, int side, int decodedMeta) {
IIcon icon = null;
try {
IIcon icon = block.getIcon(side, decodedMeta);
if (icon != null) {
return icon;
} else {
return Blocks.cobblestone.getIcon(0, 0);
}
icon = block.getIcon(side, decodedMeta);
} catch (Throwable t) {
try {
return block.getBlockTextureFromSide(side);
} catch (Throwable t2) {
return Blocks.cobblestone.getIcon(0, 0);
icon = block.getBlockTextureFromSide(side);
} catch (Throwable ignored) {
}
} finally {
if (icon == null) {
icon = Blocks.cobblestone.getIcon(0, 0);
}
}
return icon;
}
@Override