diff --git a/src/main/java/net/knarcraft/paidsigns/utility/TabCompleteHelper.java b/src/main/java/net/knarcraft/paidsigns/utility/TabCompleteHelper.java index ab9011b..a294d80 100644 --- a/src/main/java/net/knarcraft/paidsigns/utility/TabCompleteHelper.java +++ b/src/main/java/net/knarcraft/paidsigns/utility/TabCompleteHelper.java @@ -3,6 +3,7 @@ package net.knarcraft.paidsigns.utility; import net.knarcraft.paidsigns.PaidSigns; import org.bukkit.Bukkit; import org.bukkit.permissions.Permission; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.HashMap; @@ -30,7 +31,11 @@ public final class TabCompleteHelper { * @param typedText

The text the player has started typing

* @return

The given string values that start with the player's typed text

*/ - public static List filterMatchingStartsWith(List values, String typedText) { + public static List filterMatchingStartsWith(@NotNull List values, String typedText) { + //This little trick makes sure tab-completion works for paid sign names + if (!values.isEmpty() && values.get(0).startsWith("\"")) { + typedText = "\"" + typedText; + } List configValues = new ArrayList<>(); for (String value : values) { if (value.toLowerCase().startsWith(typedText.toLowerCase())) {