Fix crafting task issues

This commit is contained in:
Raoul Van den Berge
2016-05-21 13:37:27 +02:00
parent d1cd0c176c
commit 5ababd6946
2 changed files with 6 additions and 18 deletions

View File

@@ -85,7 +85,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
private List<ClientSideMachine> clientSideMachines = new ArrayList<ClientSideMachine>();
private List<CraftingPattern> patterns = new ArrayList<CraftingPattern>();
private List<ICraftingTask> craftingTasks = new ArrayList<ICraftingTask>();
private Stack<ICraftingTask> craftingTasks = new Stack<ICraftingTask>();
private List<ICraftingTask> craftingTasksToAdd = new ArrayList<ICraftingTask>();
private List<ICraftingTask> craftingTasksToCancel = new ArrayList<ICraftingTask>();
@@ -143,15 +143,12 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
craftingTasks.addAll(craftingTasksToAdd);
craftingTasksToAdd.clear();
Iterator<ICraftingTask> craftingTaskIterator = craftingTasks.iterator();
if (!craftingTasks.empty()) {
ICraftingTask top = craftingTasks.peek();
if (ticks % top.getPattern().getCrafter(worldObj).getSpeed() == 0 && top.update(this)) {
top.onDone(this);
while (craftingTaskIterator.hasNext()) {
ICraftingTask task = craftingTaskIterator.next();
if (ticks % task.getPattern().getCrafter(worldObj).getSpeed() == 0 && task.update(this)) {
task.onDone(this);
craftingTaskIterator.remove();
craftingTasks.pop();
}
}
} else {