From 332dd342629280318fb01ae963930d6bda5cec21 Mon Sep 17 00:00:00 2001 From: byteful Date: Mon, 17 Jun 2024 06:07:57 -0500 Subject: [PATCH] v1.4.0 --- build.gradle | 2 +- .../byteful/plugin/leveltools/listeners/XPListener.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 2244926..523fee6 100644 --- a/build.gradle +++ b/build.gradle @@ -83,7 +83,7 @@ shadowJar { def targetJavaVersion = 8 java { def javaVersion = JavaVersion.toVersion(targetJavaVersion) - sourceCompatibility = javaVersion + sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = javaVersion if (JavaVersion.current() < javaVersion) { toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) diff --git a/src/main/java/me/byteful/plugin/leveltools/listeners/XPListener.java b/src/main/java/me/byteful/plugin/leveltools/listeners/XPListener.java index 1127a23..70b899f 100644 --- a/src/main/java/me/byteful/plugin/leveltools/listeners/XPListener.java +++ b/src/main/java/me/byteful/plugin/leveltools/listeners/XPListener.java @@ -50,9 +50,11 @@ protected void handle(LevelToolsItem tool, Player player, double modifier) { int newLevel = tool.getLevel() + 1; final int maxLevel = LevelToolsPlugin.getInstance().getConfig().getInt("max_level"); - if (newLevel > maxLevel && tool.getXp() != tool.getMaxXp()) { - tool.setXp(tool.getMaxXp()); - LevelToolsUtil.setHand(player, tool.getItemStack()); + if (newLevel > maxLevel) { + if (tool.getXp() != tool.getMaxXp()) { + tool.setXp(tool.getMaxXp()); + LevelToolsUtil.setHand(player, tool.getItemStack()); + } return; }