Adds tab completion to the decrypt command
This commit is contained in:
parent
610d798093
commit
620894f0b1
@ -4,13 +4,15 @@ import net.knarcraft.bookswithoutborders.BooksWithoutBorders;
|
||||
import net.knarcraft.bookswithoutborders.utility.EncryptionHelper;
|
||||
import net.knarcraft.bookswithoutborders.utility.InventoryHelper;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BookMeta;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static net.knarcraft.bookswithoutborders.BooksWithoutBordersSettings.getBookFolder;
|
||||
import static net.knarcraft.bookswithoutborders.BooksWithoutBordersSettings.getSlash;
|
||||
@ -18,7 +20,7 @@ import static net.knarcraft.bookswithoutborders.BooksWithoutBordersSettings.getS
|
||||
/**
|
||||
* Command executor for the decrypt command
|
||||
*/
|
||||
public class CommandDecrypt implements CommandExecutor {
|
||||
public class CommandDecrypt implements TabExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
@ -98,4 +100,15 @@ public class CommandDecrypt implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
int argumentCount = args.length;
|
||||
if (argumentCount == 1) {
|
||||
List<String> info = new ArrayList<>();
|
||||
info.add("<password>");
|
||||
return info;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user