From 666966d173a0916b85eb155f52b95ada32200fcb Mon Sep 17 00:00:00 2001 From: acrylic-style Date: Wed, 13 Nov 2024 21:25:42 +0900 Subject: [PATCH] fix exp placeholder and add default-required-level config --- build.gradle.kts | 2 +- src/main/java/net/azisaba/lifepvelevel/SpigotPlugin.java | 2 +- src/main/java/net/azisaba/lifepvelevel/sql/DBConnector.java | 2 +- src/main/resources/config.yml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 77107b5..80a38ab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "net.azisaba" -version = "2.0.1+1.15.2" +version = "2.0.2+1.15.2" repositories { mavenCentral() diff --git a/src/main/java/net/azisaba/lifepvelevel/SpigotPlugin.java b/src/main/java/net/azisaba/lifepvelevel/SpigotPlugin.java index 81d1c87..9fbd4dd 100644 --- a/src/main/java/net/azisaba/lifepvelevel/SpigotPlugin.java +++ b/src/main/java/net/azisaba/lifepvelevel/SpigotPlugin.java @@ -152,7 +152,7 @@ private static void registerPlaceholders() { registerPlayerPlaceholder( "0", "pvelevel_exp", - p -> FORMATTER_COMMAS.format(LevelCalculator.toLevel(DBConnector.getExp(p.getUniqueId()))) + p -> FORMATTER_COMMAS.format(DBConnector.getExp(p.getUniqueId())) ); registerPlayerPlaceholder( "0", diff --git a/src/main/java/net/azisaba/lifepvelevel/sql/DBConnector.java b/src/main/java/net/azisaba/lifepvelevel/sql/DBConnector.java index 1f7994c..e5bcf58 100644 --- a/src/main/java/net/azisaba/lifepvelevel/sql/DBConnector.java +++ b/src/main/java/net/azisaba/lifepvelevel/sql/DBConnector.java @@ -196,7 +196,7 @@ public static void setRequiredLevels(@NotNull String mmid, long level) { } public static long getRequiredLevel(@NotNull String mmid) { - return REQUIRED_LEVELS.getOrDefault(mmid, 0L); + return REQUIRED_LEVELS.getOrDefault(mmid, SpigotPlugin.getInstance().getConfig().getLong("default-required-level", 0L)); } public static void addExp(@NotNull UUID uuid, long exp) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index de3f223..f8af705 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,3 +1,4 @@ +default-required-level: 0 always-bypass: false always-bypass-if-not-negative: false enforced-mythic-type: []