Fix strange npe in facade item renderer
This commit is contained in:
parent
79bba8834f
commit
fb6a30a06c
1 changed files with 9 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue