本文整理汇总了Java中fr.evercraft.everapi.plugin.EPlugin类的典型用法代码示例。如果您正苦于以下问题:Java EPlugin类的具体用法?Java EPlugin怎么用?Java EPlugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EPlugin类属于fr.evercraft.everapi.plugin包,在下文中一共展示了EPlugin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getArgs
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public <T> List<T> getArgs(int index, ArgTriFunction<EPlugin<?>, CommandSource, String, T> type) throws EMessageException {
List<String> values = new ArrayList<String>();
int cpt = 0;
for (String arg : this.args) {
if (cpt >= index) {
values.add(arg);
}
cpt++;
}
List<T> result = new ArrayList<T>();
for (String value : values) {
result.add(type.apply(this.plugin, this.source, this.values.get(value)));
}
return result;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:17,代码来源:Args.java
示例2: getArgsUnion
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public <V, T extends Collection<V>> List<V> getArgsUnion(int index, ArgTriFunction<EPlugin<?>, CommandSource, String, T> type) throws EMessageException {
List<String> values = new ArrayList<String>();
int cpt = 0;
for (String arg : this.args) {
if (cpt >= index) {
values.add(arg);
}
cpt++;
}
List<V> result = new ArrayList<V>();
for (String value : values) {
result.addAll(type.apply(this.plugin, this.source, this.values.get(value)));
}
return result;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:17,代码来源:Args.java
示例3: helpSubCommand
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public void helpSubCommand(LinkedHashMap<String, ICommand> commands, CommandSource source, EPlugin<?> plugin) {
List<Text> contents = new ArrayList<Text>();
for (Entry<String, ICommand> command : commands.entrySet()) {
Text help = command.getValue().help(source);
Text description = command.getValue().description(source);
if (help != null && description != null && !help.isEmpty() && !description.isEmpty()) {
help = help.toBuilder().color(this.help_color_help).build();
description = description.toBuilder().color(this.help_color_description).build();
contents.add(EAMessages.HELP_LINE.getFormat().toText(
"{name}", this.getButtonName(command.getKey(), help),
"{description}", description));
}
}
this.help(contents, source, plugin);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:19,代码来源:EPagination.java
示例4: help
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
private void help(List<Text> contents, CommandSource source, EPlugin<?> plugin) {
Builder title = EAMessages.HELP_TITLE.getFormat().toText(
"{plugin}", plugin.getName(),
"{version}",plugin.getVersion().orElse("1"))
.toBuilder();
String authors;
if (plugin.getAuthors().isEmpty()) {
authors = EAMessages.HELP_AUTHORS_EMPTY.getString();
} else {
authors = String.join(EAMessages.HELP_AUTHORS_JOIN.getString(), plugin.getAuthors());
}
if (EAMessages.HELP_TITLE_HOVER.has()) {
title = title.onHover(TextActions.showText(EAMessages.HELP_TITLE_HOVER.getFormat().toText(
"{authors}", authors,
"{plugin}", plugin.getName(),
"{version}", plugin.getVersion().orElse("1"))));
}
if (contents.isEmpty()) {
contents.add(this.help_empty);
}
this.send(title.build(), this.help_padding, contents, source);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:27,代码来源:EPagination.java
示例5: remove
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
/**
* Supprimé tous les horaires du plugin
* @param plugin Le plugin
* @return True si les horaire ont bien été supprimé
*/
public boolean remove(final EPlugin<?> plugin){
Iterator<Schedules> iterator = this.schedules.iterator();
boolean trouver = false;
while(iterator.hasNext()){
if (iterator.next().getPlugin().equals(plugin)){
iterator.remove();
trouver = true;
}
}
if (trouver){
actualisation();
}
return trouver;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:21,代码来源:ManagerPlannings.java
示例6: suggest
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
@Override
public Collection<String> suggest(final EPlugin<?> plugin, final CommandSource source, final List<String> command) {
try {
Args args = this.build(plugin, source, command, true);
List<String> suggests = new ArrayList<String>();
if (args.getLastMarker().isPresent()) {
ArgBiFunction<CommandSource, Args, Collection<String>> function = this.suggests_types.get(args.getLastMarker().get());
if (function != null) {
return function.apply(source, args);
}
} else if (!this.suggests_args.isEmpty() && ! args.getArgs().isEmpty()) {
if (args.getArgs().size() <= this.suggests_args.size()) {
suggests.addAll(this.suggests_args.get(args.getArgs().size()-1).apply(source, args));
} else if (this.arg_list) {
suggests.addAll(this.suggests_args.get(this.suggests_args.size()-1).apply(source, args));
}
}
if (!args.isMarkerOpen()) {
for (Entry<String, Value> type : this.types.entrySet()) {
if (!command.contains(type.getKey()) && type.getValue().getCheck().apply(source, args)) {
if (type.getValue().getType().equals(Type.LIST)) {
if (args.getArgs().size() > this.suggests_args.size()) {
suggests.add(type.getKey());
}
} else {
suggests.add(type.getKey());
}
}
}
}
return suggests;
} catch (EMessageException e) {
return Arrays.asList();
}
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:37,代码来源:BuilderArgs.java
示例7: Args
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public Args(EPlugin<?> plugin, CommandSource source, List<String> args, List<String> options,
Map<String, String> values, Map<String, List<String>> lists, String lastMarker, boolean markerOpen) {
this.plugin = plugin;
this.source = source;
this.args = args;
this.options = options;
this.values = values;
this.lists = lists;
this.lastMarker = Optional.ofNullable(lastMarker);
this.markerOpen = markerOpen;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:12,代码来源:Args.java
示例8: getList
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public <T> Optional<List<T>> getList(String marker, ArgTriFunction<EPlugin<?>, CommandSource, String, T> type) throws EMessageException {
List<String> values = this.lists.get(marker);
if (values == null) return Optional.empty();
List<T> result = new ArrayList<T>();
for (String value : values) {
result.add(type.apply(this.plugin, this.source, this.values.get(value)));
}
return Optional.of(result);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:11,代码来源:Args.java
示例9: getListUnion
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public <V, T extends Collection<V>> Optional<List<V>> getListUnion(String marker, ArgTriFunction<EPlugin<?>, CommandSource, String, T> type) throws EMessageException {
List<String> values = this.lists.get(marker);
if (values == null) return Optional.empty();
List<V> result = new ArrayList<V>();
for (String value : values) {
result.addAll(type.apply(this.plugin, this.source, this.values.get(value)));
}
return Optional.of(result);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:11,代码来源:Args.java
示例10: Schedules
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public Schedules(final EPlugin<?> plugin, final Runnable task, final Calendar calendar){
this.id = NEXT_ID++;
this.plugin = plugin;
this.task = task;
this.calendar = calendar;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:8,代码来源:Schedules.java
示例11: addListener
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public void addListener(EPlugin<?> plugin, IObjective objective) {
if (this.plugin == null) {
this.plugin = plugin.getEverAPI();
}
if (this.objectives.isEmpty()) {
System.out.println("addListener : " + this.getClass().getSimpleName());
this.plugin.getGame().getEventManager().registerListeners(this.plugin, this);
}
this.objectives.add(objective);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:12,代码来源:Score.java
示例12: commandPlugins
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
private CompletableFuture<Boolean> commandPlugins(CommandSource player) {
Collection<EPlugin<?>> plugins = getEPlugins();
List<Text> list = new ArrayList<Text>();
for (EPlugin<?> plugin : plugins){
List<Text> hover = new ArrayList<Text>();
hover.add(EAMessages.PLUGINS_ID.getFormat().toText("{id}", () -> plugin.getId()));
if (plugin.getVersion().isPresent()) {
hover.add(EAMessages.PLUGINS_VERSION.getFormat().toText("{version}", () -> plugin.getVersion().get()));
}
if (plugin.getDescription().isPresent()) {
hover.add(EAMessages.PLUGINS_DESCRIPTION.getFormat().toText("{description}", () -> plugin.getDescription().get()));
}
if (plugin.getUrl().isPresent()) {
hover.add(EAMessages.PLUGINS_URL.getFormat().toText("{url}", () -> plugin.getUrl().get()));
}
if (!plugin.getAuthors().isEmpty()) {
hover.add(EAMessages.PLUGINS_AUTHOR.getFormat().toText("{author}", () -> String.join(", ", plugin.getAuthors())));
}
list.add((plugin.isEnable() ? EAMessages.PLUGINS_ENABLE : EAMessages.PLUGINS_DISABLE).getFormat().toText("{plugin}", () -> plugin.getName()).toBuilder()
.onHover(TextActions.showText(Text.joinWith(Text.of("\n"), hover)))
.build());
}
EAMessages.PLUGINS_MESSAGE.sender()
.replace("{count}", () -> String.valueOf(plugins.size()))
.replace("{plugins}", () -> Text.joinWith(Text.of(", "), list))
.sendTo(player);
return CompletableFuture.completedFuture(true);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:34,代码来源:EAPlugins.java
示例13: getEPlugins
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
private Collection<EPlugin<?>> getEPlugins(){
Collection<EPlugin<?>> plugins = new ArrayList<EPlugin<?>>();
for (PluginContainer plugin : this.plugin.getGame().getPluginManager().getPlugins()){
if (plugin.getInstance().isPresent())
if (plugin.getInstance().get() instanceof EPlugin){
EPlugin<?> pl = (EPlugin<?>) plugin.getInstance().get();
plugins.add(pl);
}
}
return plugins;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:12,代码来源:EAPlugins.java
示例14: ETransferResult
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public ETransferResult(final EPlugin<EverEconomy> plugin, final Account account, final Account accountTo, final Currency currency, final BigDecimal amount,
final Set<Context> contexts, final ResultType result, final TransactionType transaction){
this.account = account;
this.accountTo = accountTo;
this.currency = currency;
this.amount = amount;
this.contexts = contexts;
this.result = result;
this.transaction = transaction;
new ETransactionResult(plugin, account, currency, amount, contexts, result, TransactionTypes.WITHDRAW);
new ETransactionResult(plugin, accountTo, currency, amount, contexts, result, TransactionTypes.DEPOSIT);
}
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:14,代码来源:ETransferResult.java
示例15: ETransactionResult
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public ETransactionResult(final EPlugin<EverEconomy> plugin, final Account account, final Currency currency,
final BigDecimal amount, final Set<Context> contexts, final ResultType result, final TransactionType transaction) {
this.account = account;
this.currency = currency;
this.amount = amount;
this.contexts = contexts;
this.result = result;
this.transaction = transaction;
plugin.getELogger().debug("Event EconomyTransactionEvent : (Account='" + this.account.getIdentifier() +"')");
EconomyTransactionEvent event = new EEconomyTransactionEvent(Cause.source(plugin).build(), this);
plugin.getGame().getEventManager().post(event);
}
开发者ID:EverCraft,项目名称:EverEconomy,代码行数:14,代码来源:ETransactionResult.java
示例16: build
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
@Override
public Args build(final EPlugin<?> plugin, final CommandSource source, List<String> command) {
return this.build(plugin, source, command, false);
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:5,代码来源:BuilderArgs.java
示例17: getArg
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public <T> Optional<T> getArg(int index, ArgTriFunction<EPlugin<?>, CommandSource, String, T> type) throws EMessageException {
if (index > this.args.size()-1) {
return Optional.empty();
}
return Optional.of(type.apply(this.plugin, this.source, this.args.get(index)));
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:7,代码来源:Args.java
示例18: getValue
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public <T> Optional<T> getValue(String marker, ArgTriFunction<EPlugin<?>, CommandSource, String, T> type) throws EMessageException {
String value = this.values.get(marker);
if (value == null) return Optional.empty();
return Optional.of(type.apply(this.plugin, this.source, this.values.get(value)));
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:7,代码来源:Args.java
示例19: command
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public static Cause command(final EPlugin<?> plugin, final CommandSource source) {
return Cause.builder().named(plugin.getName(), plugin).suggestNamed(source.getName(), source).build();
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:4,代码来源:UtilsCause.java
示例20: ServerDisableException
import fr.evercraft.everapi.plugin.EPlugin; //导入依赖的package包/类
public ServerDisableException(final EPlugin<?> plugin, final String message){
super(message);
this.plugin = plugin;
}
开发者ID:EverCraft,项目名称:EverAPI,代码行数:5,代码来源:ServerDisableException.java
注:本文中的fr.evercraft.everapi.plugin.EPlugin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论