From 1f580ba0834b846e066605d91fd17fe7a34f019e Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 12 May 2020 17:28:12 -0400 Subject: [PATCH] Fix saving tickets. --- .../com/songoda/ultimatemoderation/UltimateModeration.java | 4 ++-- .../java/com/songoda/ultimatemoderation/storage/Storage.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/songoda/ultimatemoderation/UltimateModeration.java b/src/main/java/com/songoda/ultimatemoderation/UltimateModeration.java index 600c00b..ae7b44d 100644 --- a/src/main/java/com/songoda/ultimatemoderation/UltimateModeration.java +++ b/src/main/java/com/songoda/ultimatemoderation/UltimateModeration.java @@ -184,7 +184,7 @@ public class UltimateModeration extends SongodaPlugin { if (storage.containsGroup("tickets")) { for (StorageRow row : storage.getRowsByGroup("tickets")) { - int id = row.get("id").asInt(); + int id = Integer.parseInt(row.get("id").asString()); Ticket ticket = new Ticket( UUID.fromString(row.get("player").asString()), row.get("subject").asString(), @@ -202,7 +202,7 @@ public class UltimateModeration extends SongodaPlugin { TicketResponse ticketResponse = new TicketResponse( UUID.fromString(row.get("author").asString()), row.get("message").asString(), - row.get("posted").asLong()); + Long.parseLong(row.get("posted").asString())); ticketResponse.setTicketId(id); ticketManager.getTicket(id).addResponse(ticketResponse); diff --git a/src/main/java/com/songoda/ultimatemoderation/storage/Storage.java b/src/main/java/com/songoda/ultimatemoderation/storage/Storage.java index d392778..5d70d90 100644 --- a/src/main/java/com/songoda/ultimatemoderation/storage/Storage.java +++ b/src/main/java/com/songoda/ultimatemoderation/storage/Storage.java @@ -64,7 +64,7 @@ public abstract class Storage { } for (Ticket ticket : instance.getTicketManager().getTickets()) { - prepareSaveItem("tickets", new StorageItem("id", ticket.getTicketId()), + prepareSaveItem("tickets", new StorageItem("id", String.valueOf(ticket.getTicketId())), new StorageItem("player", ticket.getVictim().toString()), new StorageItem("subject", ticket.getSubject()), new StorageItem("type", ticket.getType()), @@ -72,7 +72,7 @@ public abstract class Storage { new StorageItem("status", ticket.getStatus().toString())); for (TicketResponse ticketResponse : ticket.getResponses()) { - prepareSaveItem("ticketresponses", new StorageItem("posted", ticketResponse.getPostedDate()), + prepareSaveItem("ticketresponses", new StorageItem("posted", String.valueOf(ticketResponse.getPostedDate())), new StorageItem("ticketid", ticket.getTicketId()), new StorageItem("author", ticketResponse.getAuthor().toString()), new StorageItem("message", ticketResponse.getMessage()));