Skip to content

Commit 588a8e1

Browse files
authored
Merge pull request #3413 from Multiverse/fix/seperated-typo
Fix spelling error for addOnToCommaSeparated method name
2 parents 815637e + 5bd37d1 commit 588a8e1

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

src/main/java/org/mvplugins/multiverse/core/command/MVCommandCompletions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
import org.mvplugins.multiverse.core.world.generators.GeneratorPlugin;
5454
import org.mvplugins.multiverse.core.world.generators.GeneratorProvider;
5555

56-
import static org.mvplugins.multiverse.core.utils.StringFormatter.addonToCommaSeperated;
56+
import static org.mvplugins.multiverse.core.utils.StringFormatter.addOnToCommaSeparated;
5757

5858
@Service
5959
public class MVCommandCompletions extends PaperCommandCompletions {
@@ -163,7 +163,7 @@ private Collection<String> completeWithPreconditions(
163163
}
164164
}
165165
if (context.hasConfig("multiple")) {
166-
return addonToCommaSeperated(context.getInput(), handler.getCompletions(context));
166+
return addOnToCommaSeparated(context.getInput(), handler.getCompletions(context));
167167
}
168168
return handler.getCompletions(context);
169169
}
@@ -334,7 +334,7 @@ private Collection<String> suggestPlayersArray(BukkitCommandCompletionContext co
334334
matchedPlayers.add(name);
335335
}
336336
}
337-
return addonToCommaSeperated(context.getInput(), matchedPlayers);
337+
return addOnToCommaSeparated(context.getInput(), matchedPlayers);
338338
}
339339

340340
private Collection<String> suggestSpawnCategoryPropsName(BukkitCommandCompletionContext context) {

src/main/java/org/mvplugins/multiverse/core/config/node/ListConfigNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ private void setDefaults() {
120120
private void setDefaultSuggester() {
121121
if (itemSuggester instanceof SenderNodeSuggester senderItemSuggester) {
122122
this.suggester = (SenderNodeSuggester)(sender, input) ->
123-
StringFormatter.addonToCommaSeperated(input, senderItemSuggester.suggest(sender, input));
123+
StringFormatter.addOnToCommaSeparated(input, senderItemSuggester.suggest(sender, input));
124124
} else {
125-
this.suggester = input -> StringFormatter.addonToCommaSeperated(input, itemSuggester.suggest(input));
125+
this.suggester = input -> StringFormatter.addOnToCommaSeparated(input, itemSuggester.suggest(input));
126126
}
127127
}
128128

src/main/java/org/mvplugins/multiverse/core/utils/StringFormatter.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.base.Strings;
44
import com.google.common.collect.Sets;
5+
import org.jetbrains.annotations.ApiStatus;
56
import org.jetbrains.annotations.NotNull;
67
import org.jetbrains.annotations.Nullable;
78

@@ -71,11 +72,30 @@ private StringFormatter() {
7172

7273
/**
7374
* Appends a list of suggestions to the end of the input string, separated by commas.
75+
*
7476
* @param input The current input
7577
* @param addons The autocomplete suggestions
7678
* @return A collection of suggestions with the next suggestion appended
79+
*
80+
* @deprecated Method name has a spelling error. Use {@link #addOnToCommaSeparated(String, Collection)} instead.
7781
*/
82+
@Deprecated(forRemoval = true, since = "5.5")
83+
@ApiStatus.ScheduledForRemoval(inVersion = "6.0")
7884
public static Collection<String> addonToCommaSeperated(@Nullable String input, @NotNull Collection<String> addons) {
85+
return addOnToCommaSeparated(input, addons);
86+
}
87+
88+
/**
89+
* Appends a list of suggestions to the end of the input string, separated by commas.
90+
*
91+
* @param input The current input
92+
* @param addons The autocomplete suggestions
93+
* @return A collection of suggestions with the next suggestion appended
94+
*
95+
* @since 5.5
96+
*/
97+
@ApiStatus.AvailableSince("5.5")
98+
public static Collection<String> addOnToCommaSeparated(@Nullable String input, @NotNull Collection<String> addons) {
7999
if (Strings.isNullOrEmpty(input)) {
80100
return addons;
81101
}

0 commit comments

Comments
 (0)