From a130ce97ad72c5b1ae6c95c40b9e32ebac538d64 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Thu, 23 Aug 2018 19:07:46 +0300 Subject: [PATCH] Fixed Session PlayerKills not being saved --- .../main/java/com/djrapitops/plan/data/container/Session.java | 2 +- .../plan/system/database/databases/sql/tables/KillsTable.java | 4 ++-- .../system/database/databases/sql/tables/SessionsTable.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/container/Session.java b/Plan/src/main/java/com/djrapitops/plan/data/container/Session.java index 7a83447c0..704ad2346 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/container/Session.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/container/Session.java @@ -199,7 +199,7 @@ public class Session extends DataContainer implements DateHolder { return worldTimes; } - private List getPlayerKills() { + public List getPlayerKills() { return playerKills; } diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/KillsTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/KillsTable.java index f7ee98ee6..a48ed9e62 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/KillsTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/KillsTable.java @@ -117,7 +117,7 @@ public class KillsTable extends UserIDTable { UUID victim = UUID.fromString(uuidS); long date = set.getLong(Col.DATE.get()); String weapon = set.getString(Col.WEAPON.get()); - session.getUnsafe(SessionKeys.PLAYER_KILLS).add(new PlayerKill(victim, weapon, date)); + session.getPlayerKills().add(new PlayerKill(victim, weapon, date)); } return null; } @@ -286,7 +286,7 @@ public class KillsTable extends UserIDTable { for (Session session : sessions) { int sessionID = session.getUnsafe(SessionKeys.DB_ID); // Every kill - for (PlayerKill kill : session.getUnsafe(SessionKeys.PLAYER_KILLS)) { + for (PlayerKill kill : session.getPlayerKills()) { UUID victim = kill.getVictim(); long date = kill.getDate(); String weapon = kill.getWeapon(); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/SessionsTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/SessionsTable.java index 7aae3de6a..5730b55e7 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/SessionsTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/SessionsTable.java @@ -113,7 +113,7 @@ public class SessionsTable extends UserIDTable { } db.getWorldTimesTable().saveWorldTimes(uuid, sessionID, session.getUnsafe(SessionKeys.WORLD_TIMES)); - db.getKillsTable().savePlayerKills(uuid, sessionID, session.getUnsafe(SessionKeys.PLAYER_KILLS)); + db.getKillsTable().savePlayerKills(uuid, sessionID, session.getPlayerKills()); } /**