mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Fixed remaining crafting time computation when removing items from crafting queue
This commit is contained in:
parent
39e23bc729
commit
6f6a40aadd
@ -110,9 +110,12 @@ public class CraftingStatus {
|
|||||||
final int index = crafts.indexOf(item);
|
final int index = crafts.indexOf(item);
|
||||||
Validate.isTrue(index >= 0, "Could not find item in queue");
|
Validate.isTrue(index >= 0, "Could not find item in queue");
|
||||||
crafts.remove(index);
|
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++)
|
for (int j = index; j < crafts.size(); j++)
|
||||||
crafts.get(j).removeDelay(remaining);
|
crafts.get(j).removeDelay(gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
Loading…
Reference in New Issue
Block a user