From 6b57840b8f7d8c6e69a21c6a7810661f4ca03030 Mon Sep 17 00:00:00 2001 From: octarine-noise Date: Sun, 10 Aug 2014 16:02:13 +0200 Subject: [PATCH] fix possible ClassCastException when leaf block uses non-atlas texture --- .../client/render/impl/RenderBlockBetterLeaves.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockBetterLeaves.java b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockBetterLeaves.java index 79a323c..cd939de 100644 --- a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockBetterLeaves.java +++ b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockBetterLeaves.java @@ -52,7 +52,11 @@ public class RenderBlockBetterLeaves extends RenderBlockAOBase implements IRende // find generated texture to render with, assume the // "true" texture of the block is the one on the north size - TextureAtlasSprite blockLeafIcon = (TextureAtlasSprite) block.getIcon(world, x, y, z, ForgeDirection.NORTH.ordinal()); + TextureAtlasSprite blockLeafIcon = null; + try { + blockLeafIcon = (TextureAtlasSprite) block.getIcon(world, x, y, z, ForgeDirection.NORTH.ordinal()); + } catch (ClassCastException e) { + } if (blockLeafIcon == null) { BetterFoliage.log.debug(String.format("null leaf texture, x:%d, y:%d, z:%d, meta:%d, block:%s", x, y, z, blockAccess.getBlockMetadata(x, y, z), block.getClass().getName())); return true;