Fix TestCommand
Dieser Commit ist enthalten in:
Ursprung
451d30a496
Commit
57b5c2b81b
@ -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());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren