From 0aeb107d21a733745c030a42c1f9e6a996c01ffc Mon Sep 17 00:00:00 2001 From: wwrpg Date: Wed, 6 May 2015 14:17:04 -0700 Subject: [PATCH] Fixed #442 Added limits to meta to prevent ArrayIndexOutOfBoundsException similar to BlockBOPNewDirt.java. Still probably a deeper issue here, but this will prevent crashes for now --- src/main/java/biomesoplenty/common/blocks/BlockBOPNewGrass.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPNewGrass.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPNewGrass.java index 18fba709c..0903cf15a 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPNewGrass.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPNewGrass.java @@ -212,6 +212,7 @@ public class BlockBOPNewGrass extends BlockGrass implements ISubLocalization @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { + if (meta > grassTypes.length-1) meta = 0; return side == 1 ? Blocks.grass.getIcon(side, meta) : side == 0 ? BOPCBlocks.newBopDirt.getIcon(side, meta * 2) : grassIcons[2 * meta]; } @@ -220,6 +221,7 @@ public class BlockBOPNewGrass extends BlockGrass implements ISubLocalization public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) { int meta = world.getBlockMetadata(x, y, z); + if (meta > grassTypes.length-1) meta = 0; if (side == 0) {