Cache leaf block IDs

This commit is contained in:
octarine-noise
2014-06-30 22:15:57 +02:00
parent 220f2356d8
commit 37ffa219fc
2 changed files with 25 additions and 5 deletions

View File

@@ -24,10 +24,7 @@ public class RenderBlockBetterLeaves extends RenderBlockAOBase implements IRende
public boolean isBlockAccepted(IBlockAccess blockAccess, int x, int y, int z, Block block, int original) {
if (!Config.leavesEnabled) return false;
if (original > 0 && original < 42) return false;
for (Class<?> clazz : BetterFoliageClient.blockLeavesClasses)
if (clazz.isAssignableFrom(block.getClass()))
return !isBlockSurrounded(blockAccess, x, y, z);
return false;
return BetterFoliageClient.leafBlockIDs.contains(Block.blockRegistry.getIDForObject(block)) && !isBlockSurrounded(blockAccess, x, y, z);
}
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {