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) { private IIcon tryGetBlockIcon(Block block, int side, int decodedMeta) {
IIcon icon = null;
try { try {
IIcon icon = block.getIcon(side, decodedMeta); icon = block.getIcon(side, decodedMeta);
if (icon != null) {
return icon;
} else {
return Blocks.cobblestone.getIcon(0, 0);
}
} catch (Throwable t) { } catch (Throwable t) {
try { try {
return block.getBlockTextureFromSide(side); icon = block.getBlockTextureFromSide(side);
} catch (Throwable t2) { } catch (Throwable ignored) {
return Blocks.cobblestone.getIcon(0, 0); }
} finally {
if (icon == null) {
icon = Blocks.cobblestone.getIcon(0, 0);
} }
} }
return icon;
} }
@Override @Override