Implements #37 and improves material tab-completion

This commit is contained in:
2024-05-16 13:14:33 +02:00
parent bfc0eb7334
commit d101c7ed02
23 changed files with 486 additions and 76 deletions

View File

@ -7,6 +7,10 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* An abstract arena edit command, implementing input validation
*/
@ -110,4 +114,15 @@ public abstract class EditArenaCommand implements CommandExecutor {
return material;
}
/**
* Splits the given string on comma, and returns a set of its parts
*
* @param input <p>The input string to get as a set</p>
* @return <p>The resulting string set</p>
*/
@NotNull
protected Set<String> asSet(@NotNull String input) {
return new HashSet<>(List.of(input.split(",")));
}
}