From 7c7052f5b9f9c7d9c20a6ec3ba8ab933d3a0703e Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 3 Jun 2023 14:23:15 +0100 Subject: [PATCH] Placeholders with identical patterns will now override previous registrations --- .../eco/core/integrations/placeholder/PlaceholderManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderManager.java b/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderManager.java index e8c25d31..a8e72a7d 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderManager.java +++ b/eco-api/src/main/java/com/willfp/eco/core/integrations/placeholder/PlaceholderManager.java @@ -98,6 +98,7 @@ public final class PlaceholderManager { // Storing as immutable set leads to slower times to register placeholders, but much // faster times to access registrations. Set pluginPlaceholders = new HashSet<>(REGISTERED_PLACEHOLDERS.get(placeholder.getPlugin())); + pluginPlaceholders.removeIf(p -> p.getPattern().equals(placeholder.getPattern())); pluginPlaceholders.add(placeholder); REGISTERED_PLACEHOLDERS.put(placeholder.getPlugin(), ImmutableSet.copyOf(pluginPlaceholders)); }