Doout Posted June 29, 2013 Posted June 29, 2013 /** * @return The item that is edible to eat. * @author Baheer */ public Item getEdibleItem() { Item[] is = client.getInventory().getItems(); for (Item i : is) { if (i == null) continue; if (i.getDefinition() == null || i.getDefinition().getActions() == null || i.getDefinition().getActions()[0] == null) { continue; } if (i.getDefinition().getActions()[0].contains("Eat")) { return i; } } return null; } 1
oTroll Posted June 29, 2013 Posted June 29, 2013 You can put continue; in if statements? I thought it was only switch statements
Doout Posted June 29, 2013 Author Posted June 29, 2013 You can put continue; in if statements? I thought it was only switch statements it is for the for loop