Here you can find the source of arrayHas(int[] arr, int val)
public static boolean arrayHas(int[] arr, int val)
//package com.java2s; /**/*from ww w.j a va 2 s. com*/ * This class was created by <Vazkii>. It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania * * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php * * File Created @ [Feb 14, 2015, 3:28:54 PM (GMT)] */ public class Main { /** * Helper method to check if an int array contains an int. */ public static boolean arrayHas(int[] arr, int val) { for (int element : arr) if (element == val) return true; return false; } }