public void ServerUpdate(float delta) { if (this.queue.Count == 0) { return; } ItemCraftTask task = this.queue.Peek(); if (task.cancelled) { task.owner.Command("note.craft_done", (object)task.taskUID, (object)0); this.queue.Dequeue(); } else { float currentCraftLevel = task.owner.currentCraftLevel; if ((double)task.endTime > (double)Time.get_realtimeSinceStartup()) { return; } if ((double)task.endTime == 0.0) { float scaledDuration = ItemCrafter.GetScaledDuration(task.blueprint, currentCraftLevel); task.endTime = Time.get_realtimeSinceStartup() + scaledDuration; if (!Object.op_Inequality((Object)task.owner, (Object)null)) { return; } task.owner.Command("note.craft_start", (object)task.taskUID, (object)scaledDuration, (object)task.amount); if (!task.owner.IsAdmin || !Craft.instant) { return; } task.endTime = Time.get_realtimeSinceStartup() + 1f; } else { this.FinishCrafting(task); if (task.amount <= 0) { this.queue.Dequeue(); } else { task.endTime = 0.0f; } } } }
public void ServerUpdate(float delta) { if (this.queue.Count == 0) { return; } ItemCraftTask itemCraftTask = this.queue.Peek(); if (itemCraftTask.cancelled) { itemCraftTask.owner.Command("note.craft_done", new object[] { itemCraftTask.taskUID, 0 }); this.queue.Dequeue(); return; } float single = itemCraftTask.owner.currentCraftLevel; if (itemCraftTask.endTime > UnityEngine.Time.realtimeSinceStartup) { return; } if (itemCraftTask.endTime != 0f) { this.FinishCrafting(itemCraftTask); if (itemCraftTask.amount > 0) { itemCraftTask.endTime = 0f; return; } this.queue.Dequeue(); return; } float scaledDuration = ItemCrafter.GetScaledDuration(itemCraftTask.blueprint, single); itemCraftTask.endTime = UnityEngine.Time.realtimeSinceStartup + scaledDuration; if (itemCraftTask.owner != null) { itemCraftTask.owner.Command("note.craft_start", new object[] { itemCraftTask.taskUID, scaledDuration, itemCraftTask.amount }); if (itemCraftTask.owner.IsAdmin && Craft.instant) { itemCraftTask.endTime = UnityEngine.Time.realtimeSinceStartup + 1f; } } }