you know im glad you mentioned the getInventory function, whenever i use just "inventory" it will return the correct number of ores on the first cycle then the next 3 it returns 0, either way here is the final code minus the removal of generics
<T extends ItemContainer>int getOreCount ( T itemContainer, int... IDs)
{
if (itemContainer != null)
return (int)itemContainer.getAmount(IDs);
return 0;
}
public int onLoop() throws InterruptedException
{
log(Integer.toString(getOreCount(getInventory(),IDs[0],IDs[1])));
return random(200, 300);
}
which so far is working fine and ended up being way more efficient than the old code, although Im not sure if checking for a null ItemContainer reference is necessary since that never seems to be the case, tho i suppose if i don't need to check if it's null i could just narrow it down to
log(Long.toString(getInventory().getAmount(IDs[0],IDs[1])));