diff --git a/SpigotCore_Main/src/de/steamwar/acommand/TestCommand.java b/SpigotCore_Main/src/de/steamwar/acommand/TestCommand.java deleted file mode 100644 index 8444aba..0000000 --- a/SpigotCore_Main/src/de/steamwar/acommand/TestCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2020 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.acommand; - -import de.steamwar.command.SWCommand; -import de.steamwar.command.TypeMapper; -import org.bukkit.Material; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -public class TestCommand extends SWCommand { - - public TestCommand() { - // Register this command as 'test' - super("test"); - } - - // One Help Command, the first Parameter should be some kind of CommandSender - // The second argument can only be a varArgs string of what arguments were tried to map - @Register(help = true) - public void testHelp(Player player, String... args) { - player.sendMessage("This is your help message"); - } - - // One Command, the first Parameter should be some kind of CommandSender - @Register - public void test(Player player) { - - } - - // 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("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("solidMaterial") - public TypeMapper materialTypeMapper() { - List tabCompletes = Arrays.stream(Material.values()) - .filter(Material::isSolid) - .map(Material::name) - .map(String::toLowerCase) - .collect(Collectors.toList()); - return new TypeMapper() { - @Override - public Material map(String[] previous, String s) { - return Material.valueOf(s.toUpperCase()); - } - - @Override - public List tabCompletes(CommandSender commandSender, String[] previous, String s) { - return tabCompletes; - } - }; - } - -}