diff --git a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java index 445b9a1b8..29fb25b29 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/stats/StatsRepository.java @@ -79,7 +79,19 @@ public class StatsRepository extends RepositoryBase { try (Connection c = getConnection()) { - executeInsert(c, "INSERT INTO stats (name) VALUES (?);", rs -> onComplete.run(), () -> {}, new ColumnVarChar("name", 100, name)); + executeInsert(c, "INSERT INTO stats (name) VALUES (?);", rs -> + { + if (rs.next()) + { + final int id = rs.getInt(1); + try (CallableStatement cs = c.prepareCall("{call accountStatsCreateBucketData(?)}")) + { + cs.setInt("stat", id); + cs.execute(); + onComplete.run(); + } + } + }, () -> {}, new ColumnVarChar("name", 100, name)); } catch (SQLException e) {