public static void moveItem(String itemName, int indexGoal) {
SpriteItem item = Inventory.newQuery().names(itemName).results().first();
if (item != null) {
if (item.getIndex() != indexGoal) {
Interactable start = item.getBounds();
Interactable end = Inventory.getBoundsOf(indexGoal);
if (start != null && end != null) {
log.info("Dragging " + item + " from " + item.getIndex() + " to " + indexGoal);
if (Mouse.drag(start, end)) {
// delay
}
} else {
log.warn("Failed to locate the item or bounds of goal index location");
}
}
}
}