Fix ArrayIndexOutOfBoundsException in Flower Bag. (#3073)

Can't have i set to -1 and then access an ArrayList using that as the index immediately afterwards.
This commit is contained in:
Vaelzan authored and Vincent Lee committed 2019-12-30 16:45:35 -06:00
1 parent 3d7dc85f5d
commit 74c1bb464f
1 file changed
+1 -1
@@ -87,7 +87,7 @@ public class ContainerFlowerBag extends Container {
} else {
Block b = Block.getBlockFromItem(itemstack.getItem());
int i = b instanceof BlockModFlower ? ((BlockModFlower) b).color.getId() : -1;
if(i < 16) {
if(i >= 0 && i < 16) {
Slot slot1 = inventorySlots.get(i);
if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true))
return ItemStack.EMPTY;