use of com.bencodez.advancedcore.api.user.UserStorage in project AdvancedCore by BenCodez.
the class AdvancedCorePlugin method loadTabComplete.
public void loadTabComplete() {
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(AllPlayer)", new ArrayList<String>()) {
@Override
public void reload() {
ArrayList<String> players = new ArrayList<String>();
for (String name : getUuidNameCache().values()) {
if (!players.contains(name)) {
players.add(name);
}
}
setReplace(players);
}
@Override
public void updateReplacements() {
for (Player player : Bukkit.getOnlinePlayers()) {
if (!getReplace().contains(player.getName())) {
getReplace().add(player.getName());
}
}
}
});
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(Player)", new ArrayList<String>()) {
@Override
public void reload() {
}
@Override
public void updateReplacements() {
ArrayList<String> list = new ArrayList<String>();
for (Player player : Bukkit.getOnlinePlayers()) {
list.add(player.getName());
}
setReplace(list);
}
});
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(PlayerExact)", new ArrayList<String>()) {
@Override
public void reload() {
}
@Override
public void updateReplacements() {
ArrayList<String> list = new ArrayList<String>();
for (Player player : Bukkit.getOnlinePlayers()) {
list.add(player.getName());
}
setReplace(list);
}
});
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(uuid)", new ArrayList<String>()) {
@Override
public void reload() {
ArrayList<String> uuids = new ArrayList<String>();
for (String name : getUuidNameCache().keySet()) {
if (!uuids.contains(name)) {
uuids.add(name);
}
}
setReplace(uuids);
}
@Override
public void updateReplacements() {
for (Player player : Bukkit.getOnlinePlayers()) {
if (!getReplace().contains(player.getUniqueId().toString())) {
getReplace().add(player.getUniqueId().toString());
}
}
}
});
ArrayList<String> options = new ArrayList<String>();
options.add("True");
options.add("False");
TabCompleteHandler.getInstance().addTabCompleteOption("(Boolean)", options);
options = new ArrayList<String>();
TabCompleteHandler.getInstance().addTabCompleteOption("(List)", options);
TabCompleteHandler.getInstance().addTabCompleteOption("(String)", options);
TabCompleteHandler.getInstance().addTabCompleteOption("(Text)", options);
TabCompleteHandler.getInstance().addTabCompleteOption("(Number)", options);
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(Reward)", options) {
@Override
public void reload() {
ArrayList<String> rewards = new ArrayList<String>();
for (Reward reward : rewardHandler.getRewards()) {
if (!reward.getConfig().isDirectlyDefinedReward()) {
rewards.add(reward.getRewardName());
}
}
setReplace(rewards);
}
@Override
public void updateReplacements() {
}
});
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(ChoiceReward)", options) {
@Override
public void reload() {
ArrayList<String> rewards = new ArrayList<String>();
for (Reward reward : rewardHandler.getRewards()) {
if (reward.getConfig().getEnableChoices()) {
rewards.add(reward.getRewardName());
}
}
setReplace(rewards);
}
@Override
public void updateReplacements() {
}
});
ArrayList<String> method = new ArrayList<String>();
for (InputMethod me : InputMethod.values()) {
method.add(me.toString());
}
TabCompleteHandler.getInstance().addTabCompleteOption("(RequestMethod)", method);
ArrayList<String> userStorage = new ArrayList<String>();
for (UserStorage storage : UserStorage.values()) {
userStorage.add(storage.toString());
}
TabCompleteHandler.getInstance().addTabCompleteOption("(UserStorage)", userStorage);
ArrayList<String> times = new ArrayList<String>();
for (TimeType ty : TimeType.values()) {
times.add(ty.toString());
}
TabCompleteHandler.getInstance().addTabCompleteOption("(TimeType)", times);
}
Aggregations