use of com.bencodez.advancedcore.api.command.TabCompleteHandle in project VotingPlugin by Ben12345rocks.
the class CommandLoader method loadTabComplete.
/**
* Load tab complete.
*/
public void loadTabComplete() {
ArrayList<String> sites = new ArrayList<String>();
for (VoteSite site : plugin.getVoteSites()) {
sites.add(site.getKey());
}
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(Sitename)", sites) {
@Override
public void reload() {
ArrayList<String> sites = new ArrayList<String>();
for (VoteSite site : plugin.getVoteSites()) {
sites.add(site.getKey());
}
setReplace(sites);
}
@Override
public void updateReplacements() {
}
});
ArrayList<String> topVoter = new ArrayList<String>();
for (TopVoter top : TopVoter.values()) {
topVoter.add(top.toString());
}
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(topvoter)", topVoter) {
@Override
public void reload() {
ArrayList<String> topVoter = new ArrayList<String>();
for (TopVoter top : TopVoter.values()) {
topVoter.add(top.toString());
}
setReplace(topVoter);
}
@Override
public void updateReplacements() {
}
});
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(VoteShop)", sites) {
@Override
public void reload() {
ArrayList<String> sites = new ArrayList<String>();
for (String str : plugin.getGui().getChestShopIdentifiers()) {
sites.add(str);
}
setReplace(sites);
}
@Override
public void updateReplacements() {
}
});
}
Aggregations