From 41140c4f7b17c9e42c70199b3db2519b0e9b1dd2 Mon Sep 17 00:00:00 2001 From: Seb Date: Thu, 14 Apr 2022 08:58:02 +0100 Subject: [PATCH] fix(command): Fixed broken XP issue (#87) --- .../de/voidtech/gerald/commands/utils/ExperienceCommand.java | 2 +- src/main/java/de/voidtech/gerald/service/ExperienceService.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/voidtech/gerald/commands/utils/ExperienceCommand.java b/src/main/java/de/voidtech/gerald/commands/utils/ExperienceCommand.java index 5688b4be..8cf25b2c 100644 --- a/src/main/java/de/voidtech/gerald/commands/utils/ExperienceCommand.java +++ b/src/main/java/de/voidtech/gerald/commands/utils/ExperienceCommand.java @@ -143,7 +143,7 @@ private void sendLevelCard(MessageChannel channel, Member member, long serverID) Experience userXP = xpService.getUserExperience(member.getId(), serverID); byte[] xpCard = xpService.getExperienceCard(member.getUser().getAvatarUrl(), - userXP.getCurrentExperience(), xpService.xpNeededForLevel(userXP.getLevel()), + userXP.getCurrentExperience(), xpService.xpNeededForLevel(userXP.getLevel() + 1), userXP.getLevel(), 1, member.getUser().getName() + "#" + member.getUser().getDiscriminator(), "#FF0000", "#2E2E2E"); channel.sendFile(xpCard, "xpcard.png").queue(); diff --git a/src/main/java/de/voidtech/gerald/service/ExperienceService.java b/src/main/java/de/voidtech/gerald/service/ExperienceService.java index dcb122d2..10ca2047 100644 --- a/src/main/java/de/voidtech/gerald/service/ExperienceService.java +++ b/src/main/java/de/voidtech/gerald/service/ExperienceService.java @@ -126,6 +126,7 @@ public boolean serverHasRoleForLevel(long id, long level) { } private void saveUserExperience(Experience userXP) { + System.out.println("Saving user XP"); try(Session session = sessionFactory.openSession()) { session.getTransaction().begin();