public void run() { Foodistan fdistan = Foodistan.getfoodistan(); while (System.currentTimeMillis() <= Foodistan.getfoodistan().getFoodistanEndTime()) { for (int k = 0; k < fdistan.getChefs().size(); k++) { Chef c = fdistan.chefs.get(k); if (((c.getcStatus() == chefStatus.BUSY) && (c.getCookStartTime() + (c.getCurrentCookTime())) < System.currentTimeMillis())) { Item itm = new Item(ItemType.BURGER); fdistan.getMg().refillInventory(itm); fdistan.chefs.get(k).setcStatus(chefStatus.SPEEDUPDATE); fdistan .chefs .get(k) .setCurrentCookTime(fdistan.chefs.get(k).getCurrentCookTime() * fdistan.getSpeedUp()); } } } }