From 151fb08db89a094db832e893ddb09c7ada604105 Mon Sep 17 00:00:00 2001 From: Rothes <449181985@qq.com> Date: Fri, 28 Jan 2022 13:40:39 +0800 Subject: [PATCH 1/2] Fix PlaceholderExpansion may not unregistered --- .../placeholderapi/expansion/manager/LocalExpansionManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java index ff9de96..e8d3fa2 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java @@ -286,7 +286,7 @@ public final class LocalExpansionManager implements Listener { @ApiStatus.Internal public boolean unregister(@NotNull final PlaceholderExpansion expansion) { - if (expansions.remove(expansion.getIdentifier()) == null) { + if (expansions.remove(expansion.getIdentifier().toLowerCase()) == null) { return false; } From bfc30a8703c1e4caf50d27a506f60e64a768d049 Mon Sep 17 00:00:00 2001 From: Rothes <449181985@qq.com> Date: Sat, 26 Mar 2022 09:09:50 +0800 Subject: [PATCH 2/2] `Locale.ROOT` param --- .../expansion/manager/LocalExpansionManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java index e8d3fa2..3286071 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java @@ -125,7 +125,7 @@ public final class LocalExpansionManager implements Listener { public PlaceholderExpansion getExpansion(@NotNull final String identifier) { expansionsLock.lock(); try { - return expansions.get(identifier.toLowerCase()); + return expansions.get(identifier.toLowerCase(Locale.ROOT)); } finally { expansionsLock.unlock(); } @@ -193,7 +193,7 @@ public final class LocalExpansionManager implements Listener { @ApiStatus.Internal public boolean register(@NotNull final PlaceholderExpansion expansion) { - final String identifier = expansion.getIdentifier().toLowerCase(); + final String identifier = expansion.getIdentifier().toLowerCase(Locale.ROOT); if (!expansion.canRegister()) { return false; @@ -286,7 +286,7 @@ public final class LocalExpansionManager implements Listener { @ApiStatus.Internal public boolean unregister(@NotNull final PlaceholderExpansion expansion) { - if (expansions.remove(expansion.getIdentifier().toLowerCase()) == null) { + if (expansions.remove(expansion.getIdentifier().toLowerCase(Locale.ROOT)) == null) { return false; }