本文整理汇总了Java中org.spongepowered.api.event.command.TabCompleteEvent类的典型用法代码示例。如果您正苦于以下问题:Java TabCompleteEvent类的具体用法?Java TabCompleteEvent怎么用?Java TabCompleteEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TabCompleteEvent类属于org.spongepowered.api.event.command包,在下文中一共展示了TabCompleteEvent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onTab
import org.spongepowered.api.event.command.TabCompleteEvent; //导入依赖的package包/类
@Listener
public void onTab(TabCompleteEvent.Chat e) {
String currentWord;
if (!e.getRawMessage().contains(" ")) {
currentWord = e.getRawMessage();
} else {
String[] words = SPACE.split(e.getRawMessage());
currentWord = words[words.length - 1];
}
if (currentWord.startsWith("@")) {
e.getTabCompletions().addAll(config.groups.stream().map(s -> "@"+s).filter(s -> s.toLowerCase().startsWith(currentWord.toLowerCase())).collect(Collectors.toList()));
e.getTabCompletions().addAll(game.getServer().getOnlinePlayers().stream().map(Player::getName).map(s -> "@"+s).filter(s -> s.toLowerCase().startsWith(currentWord.toLowerCase())).collect(Collectors.toList()));
}
}
开发者ID:pie-flavor,项目名称:Boop,代码行数:15,代码来源:Boop.java
示例2: onTabComplete
import org.spongepowered.api.event.command.TabCompleteEvent; //导入依赖的package包/类
@Listener(order = POST)
public void onTabComplete(TabCompleteEvent event, @Root Player player)
{
this.updateLastAction(player);
}
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:6,代码来源:AfkListener.java
示例3: PorePlayerChatTabCompleteEvent
import org.spongepowered.api.event.command.TabCompleteEvent; //导入依赖的package包/类
public PorePlayerChatTabCompleteEvent(TabCompleteEvent handle, @Source Player source) {
super(null, "", Collections.<String>emptyList());
this.handle = checkNotNull(handle, "handle");
this.source = checkNotNull(source, "source");
}
开发者ID:LapisBlue,项目名称:Pore,代码行数:6,代码来源:PorePlayerChatTabCompleteEvent.java
示例4: getHandle
import org.spongepowered.api.event.command.TabCompleteEvent; //导入依赖的package包/类
@Override
public TabCompleteEvent getHandle() {
return handle;
}
开发者ID:LapisBlue,项目名称:Pore,代码行数:5,代码来源:PorePlayerChatTabCompleteEvent.java
注:本文中的org.spongepowered.api.event.command.TabCompleteEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论