@ -183,4 +183,23 @@ public class dbWarehouseHandler extends dbHandlerBase {
}
public void LOAD_WORKORDERS() {
ArrayList<WorkOrder> deleteList = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_workorders`;");
ResultSet rs = preparedStatement.executeQuery()) {
while (rs.next()) {
int workOrderID = rs.getInt("workOrderID");
JSONObject jsonObject = new JSONObject(rs.getString("workorder"));
WorkOrder workOrder = new WorkOrder(jsonObject);
deleteList.add(workOrder);
} catch (Exception e) {
Logger.error(e);
@ -8,7 +8,6 @@
package engine.loot;
import engine.gameManager.ForgeManager;
import engine.mbEnums;
import engine.objects.Item;
import engine.objects.NPC;
@ -50,7 +49,6 @@ public class WorkOrder implements Delayed {
public WorkOrder(JSONObject jsonWorkOrder) {
this.workOrderID = ForgeManager.wordOrderCounter.incrementAndGet();
this.vendor = NPC.getNPC(jsonWorkOrder.getInt("vendor"));
this.slots_used = jsonWorkOrder.getInt("slots_used");
this.total_to_produce = jsonWorkOrder.getInt("total_to_produce");