Fixed remaining crafting time computation when removing items from crafting queue

This commit is contained in:
Jules 2024-08-26 13:38:32 -07:00
parent 39e23bc729
commit 6f6a40aadd

View File

@ -110,9 +110,12 @@ public class CraftingStatus {
final int index = crafts.indexOf(item);
Validate.isTrue(index >= 0, "Could not find item in queue");
crafts.remove(index);
final long remaining = item.getLeft();
// Time elapsed for that item
final long gain = Math.min(item.getLeft(), (long) (1000 * item.getRecipe().getCraftingTime()));
for (int j = index; j < crafts.size(); j++)
crafts.get(j).removeDelay(remaining);
crafts.get(j).removeDelay(gain);
}
@Nullable