From 7ca25c0da79e32b44fc7304c8f7c9f05d9a19a98 Mon Sep 17 00:00:00 2001 From: octarine-noise Date: Mon, 14 Jul 2014 17:52:33 +0200 Subject: [PATCH] null check for leaf icon --- .../client/render/impl/RenderBlockBetterLeaves.java | 4 ++++ 1 file changed, 4 insertions(+) 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 d9d9f3c3..30108442 100644 --- a/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockBetterLeaves.java +++ b/src/main/java/mods/betterfoliage/client/render/impl/RenderBlockBetterLeaves.java @@ -44,6 +44,10 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b // 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()); + if (blockLeafIcon == null) { + BetterFoliage.log.warn(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; + } IIcon crossLeafIcon = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(BetterFoliageClient.leafGenerator.domainName + ":" + blockLeafIcon.getIconName()); if (crossLeafIcon == null) { return true;