forked from MagicBane/Server
More WorkOrder work
This commit is contained in:
@@ -46,13 +46,13 @@ public enum ForgeManager implements Runnable {
|
|||||||
// otherwise roll what was asked for
|
// otherwise roll what was asked for
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workOrder.total_to_produce == 0) {
|
if (workOrder.total_produced >= workOrder.total_to_produce) {
|
||||||
|
|
||||||
workOrder.runCompleted = true;
|
workOrder.runCompleted = true;
|
||||||
workOrder.vendor.workOrders.remove(workOrder);
|
workOrder.vendor.workOrders.remove(workOrder);
|
||||||
|
|
||||||
Logger.info("Workorder has completed: " + workOrder.workOrderID);
|
Logger.info("Workorder has completed: " + workOrder.workOrderID);
|
||||||
// Remove this workOrder from any slots on vendor
|
workOrder.vendor.workOrders.remove(workOrder);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -114,4 +114,14 @@ public enum ForgeManager implements Runnable {
|
|||||||
rollingDuration = (long) (baseTime * Float.parseFloat(ConfigManager.MB_PRODUCTION_RATE.getValue()));
|
rollingDuration = (long) (baseTime * Float.parseFloat(ConfigManager.MB_PRODUCTION_RATE.getValue()));
|
||||||
return rollingDuration;
|
return rollingDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getAvailableSlots(WorkOrder workOrder) {
|
||||||
|
|
||||||
|
int availableSlots = workOrder.vendor.getRank();
|
||||||
|
|
||||||
|
for (WorkOrder npcWorkOrder : workOrder.vendor.workOrders) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return availableSlots;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,14 +24,15 @@ public class WorkOrder implements Delayed {
|
|||||||
public NPC vendor;
|
public NPC vendor;
|
||||||
public int slotCount;
|
public int slotCount;
|
||||||
public int total_to_produce;
|
public int total_to_produce;
|
||||||
|
public int total_produced;
|
||||||
public int templateID;
|
public int templateID;
|
||||||
public String itemName;
|
public String itemName;
|
||||||
public int prefixToken;
|
public int prefixToken;
|
||||||
public int suffixToken;
|
public int suffixToken;
|
||||||
public long rollingDuration;
|
public long rollingDuration;
|
||||||
public long completionTime;
|
public long completionTime;
|
||||||
public boolean runCompleted;
|
public boolean runCompleted = false;
|
||||||
public boolean runCanceled;
|
public boolean runCanceled = false;
|
||||||
|
|
||||||
public ArrayList<Item> cooking = new ArrayList<>();
|
public ArrayList<Item> cooking = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user