Makes sure tab completed paid sign names are quoted

This commit is contained in:
Kristian Knarvik 2022-02-26 23:15:48 +01:00
parent 36678fd2d0
commit 0f958f0908

View File

@ -4,6 +4,7 @@ import net.knarcraft.paidsigns.PaidSigns;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* A helper class for providing common tab complete options * A helper class for providing common tab complete options
@ -43,7 +44,12 @@ public final class TabCompleteHelper {
* @return <p>The names of all registered paid signs</p> * @return <p>The names of all registered paid signs</p>
*/ */
public static List<String> getPaidSignNames() { public static List<String> getPaidSignNames() {
return new ArrayList<>(PaidSigns.getInstance().getSignManager().getAllPaidSigns().keySet()); Set<String> paidSignNames = PaidSigns.getInstance().getSignManager().getAllPaidSigns().keySet();
List<String> quotedNames = new ArrayList<>(paidSignNames.size());
for (String paidSignName : paidSignNames) {
quotedNames.add("\"" + paidSignName + "\"");
}
return new ArrayList<>(quotedNames);
} }
/** /**