What do you mean by refreshing the cache? I added this to my code to put a new RS2Object in my list but it's still returning false for the interact() method. Once the TimerTask run() executes it should update the map key "rock" with a new rock.
private void mineOre() {
for(final Map<String, Object> rockMap : rockDetailsList) {
if((boolean) rockMap.get("mineable")) {
final RS2Object rock = (RS2Object) rockMap.get("rock");
boolean interacted = rock.interact("Mine");
log("Mining: " + interacted);
rockMap.put("mineable", !interacted);
canMine = false;
TimerTask task = new TimerTask() {
@Override
public void run() {
int x = rock.getX();
int y = rock.getY();
List<RS2Object> objects = getObjects().get(x, y);
for(RS2Object obj : objects) {
if(obj.getName().equals("Rocks")) {
rockMap.put("rock", obj);
break;
}
}
rockMap.put("mineable", true);
}
};
new Timer().schedule(task, 6500);
return;
}
}
}