SteamWar/SpigotCore
Archiviert
13
0

Fix TestCommand

Dieser Commit ist enthalten in:
yoyosource 2021-03-25 14:17:34 +01:00
Ursprung 451d30a496
Commit 57b5c2b81b

Datei anzeigen

@ -44,21 +44,21 @@ public class TestCommand extends SWCommand {
// Another Command, subCommands can be implemented with the Register Annotation,
// you can use custom Mappers by putting a Mapper Annotation on a Parameter
@Register({"two"})
public void testTwo(Player player, int i, @Mapper("Hello World") Material material) {
public void testTwo(Player player, int i, @Mapper("solidMaterial") Material material) {
}
// Add Custom Mapper when this command is registered, all Mapper of you class will be
// created first and than the Commands. Do not use this mapper outside your class, as
// it can only create failures. Use on your own risk. Definition order should be considered.
@Mapper("Hello World")
@Mapper("solidMaterial")
public TypeMapper<Material> materialTypeMapper() {
List<String> tabCompletes = Arrays.stream(Material.values())
.filter(Material::isSolid)
.map(Material::name)
.map(String::toLowerCase)
.collect(Collectors.toList());
return new TypeMapper<>() {
return new TypeMapper<Material>() {
@Override
public Material map(String s) {
return Material.valueOf(s.toUpperCase());