private void checkBlockDataIndex() { ArrayList inventory = shipInfo.getBlockInventory(); if (blockDataIndex < 0) { blockDataIndex = inventory.Count - 1; } if (blockDataIndex >= inventory.Count) { blockDataIndex = 0; } }