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) {
|
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
|
||||||
|
|
Loading…
Reference in a new issue