From 9060ea6bd3d8e25f7ba2e2c4e23710797c476f62 Mon Sep 17 00:00:00 2001 From: Sxtanna Date: Mon, 20 Jul 2020 17:38:18 -0400 Subject: [PATCH] updated to use new closure --- src/test/java/me/clip/placeholderapi/Values.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/test/java/me/clip/placeholderapi/Values.java b/src/test/java/me/clip/placeholderapi/Values.java index 698157e..37b393c 100644 --- a/src/test/java/me/clip/placeholderapi/Values.java +++ b/src/test/java/me/clip/placeholderapi/Values.java @@ -2,7 +2,6 @@ package me.clip.placeholderapi; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.replacer.CharsReplacer; import me.clip.placeholderapi.replacer.RegexReplacer; import me.clip.placeholderapi.replacer.Replacer; @@ -33,7 +32,7 @@ public interface Values 'a', 'b', 'c', 'd', 'e', 'f', 'k', 'l', 'm', 'o', 'r', 'x'); private final boolean colorize = true; - private final PlaceholderReplacer.Closure closure = PlaceholderReplacer.Closure.PERCENT; + private final Replacer.Closure closure = Replacer.Closure.PERCENT; @Override public @NotNull String apply(final @NotNull String text, final @Nullable OfflinePlayer player, final @NotNull Function lookup) @@ -63,7 +62,7 @@ public interface Values } // Check if the placeholder starts or ends. - if (ch == closure.start || ch == closure.end) + if (ch == closure.head || ch == closure.tail) { // If the placeholder ends. if (stage == 2) @@ -73,8 +72,8 @@ public interface Values if (translated == null) { - String name = handler.isExpansion() ? ((PlaceholderExpansion) handler).getIdentifier() : ""; - builder.append(closure.start).append(name).append('_').append(parameter).append(closure.end); + String name = ""; + builder.append(closure.head).append(name).append('_').append(parameter).append(closure.tail); } else { @@ -87,7 +86,7 @@ public interface Values } else if (stage == 1) { // If it just started | Double closures | If it's still hasn't detected the indentifier, reset. - builder.append(closure.start).append(identifier); + builder.append(closure.head).append(identifier); } identifier.setLength(0); @@ -105,7 +104,7 @@ public interface Values handler = lookup.apply(identifier.toString()); if (handler == null) { - builder.append(closure.start).append(identifier).append('_'); + builder.append(closure.head).append(identifier).append('_'); stage = 0; } else @@ -141,7 +140,7 @@ public interface Values { if (stage > 0) { - builder.append(closure.end); + builder.append(closure.tail); } builder.append(identifier); }