本文整理匯總了Java中net.minecraft.command.CommandBase.getListOfStringsMatchingLastWord方法的典型用法代碼示例。如果您正苦於以下問題:Java CommandBase.getListOfStringsMatchingLastWord方法的具體用法?Java CommandBase.getListOfStringsMatchingLastWord怎麽用?Java CommandBase.getListOfStringsMatchingLastWord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.command.CommandBase
的用法示例。
在下文中一共展示了CommandBase.getListOfStringsMatchingLastWord方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: keyTyped
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if(keyCode == Keyboard.KEY_TAB)
{ this.textInput.setMaxStringLength(60);
ArrayList<String> stringList = new ArrayList<>();
if(dictonaryList.isEmpty())
{
stringList.addAll(CommandBase.getListOfStringsMatchingLastWord(HarshenUtils.listOf(this.textInput.getText()), Block.REGISTRY.getKeys()));
for(String s : HarshenUtils.getAllOreDictionaryList())
for(ItemStack stack : OreDictionary.getOres(s))
if(Block.getBlockFromItem(stack.getItem()) != Blocks.AIR)
stringList.add(s);
dictonaryList = CommandBase.getListOfStringsMatchingLastWord(HarshenUtils.listOf(this.textInput.getText()), stringList);
}
if(!dictonaryList.isEmpty())
this.textInput.setText(dictonaryList.get(timeOver++%dictonaryList.size()));
}
else
{
timeOver = 0;
dictonaryList.clear();
}
if(keyCode == Keyboard.KEY_RETURN)
closeGui();
this.textInput.textboxKeyTyped(typedChar, keyCode);
super.keyTyped(typedChar, keyCode);
}
示例2: getTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) {
if (args.length <= 1)
return CommandBase.getListOfStringsMatchingLastWord(args, getCommandNames());
String[] players = WorldBorder.SERVER.getAllUsernames();
return CommandBase.getListOfStringsMatchingLastWord(args, players);
}
示例3: getTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) {
if (sender instanceof EntityPlayer)
{
return args.length == 1 ? CommandBase.getListOfStringsMatchingLastWord(args,FriendHandler.getFriendStringListFor(server, ((EntityPlayer)sender).getUniqueID())) : null;
}
return args.length == 1 ? CommandBase.getListOfStringsMatchingLastWord(args, server.getAllUsernames()) : null;
}
示例4: addTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List addTabCompletionOptions(ICommandSender sender, String[] args)
{
if (args.length <= 1)
return CommandBase.getListOfStringsFromIterableMatchingLastWord(args, getCommandNames());
String[] players = WorldBorder.SERVER.getAllUsernames();
return CommandBase.getListOfStringsMatchingLastWord(args, players);
}
示例5: playerLookup
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
public void playerLookup(String playerName, boolean tabPressed) {
if (tabPressed) {
List<String> players = new ArrayList<String>();
for (EntityPlayer p : (List<EntityPlayer>) world.playerEntities) {
players.add(p.getDisplayName().getUnformattedText());
}
String test[] = { playerName };
List match = CommandBase.getListOfStringsMatchingLastWord(test, players);
if (match.size() > 0) {
packageTarget = match.get(0).toString();
}
} else {
packageTarget = playerName;
}
}
示例6: addTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public List<String> addTabCompletionOptions(ICommandSender paramICommandSender, String[] args) {
if (args.length == 2) {
return CommandBase.getListOfStringsMatchingLastWord(args, Arrays.asList(SchematicHandler.getSchematics()));
}
return null;
}
示例7: addTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args) {
if (args.length == 2) {
return CommandBase.getListOfStringsMatchingLastWord(args, Arrays.asList(SchematicHandler.getSchematics()));
}
return null;
}
示例8: getTabCompletions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) {
if (usernameIndex < 0) {
return Collections.<String> emptyList();
}
return args.length == usernameIndex + 1 ? CommandBase.getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames()) : Collections.<String> emptyList();
}
示例9: addTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
switch(args.length) {
case 1: return CommandBase.getListOfStringsMatchingLastWord(args, getPlayers());
case 2: return Arrays.asList("add","set");
case 3: return Arrays.asList("current","max");
default: return null;
}
}
示例10: pontuslevel_tabList
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@HarshenCommandTabList
public static List<String> pontuslevel_tabList(MinecraftServer server, ICommandSender sender, String[] args,
BlockPos targetPos)
{
return args.length != 1? Collections.emptyList() : CommandBase.getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
示例11: matching
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
public static List<String> matching(String arg, Object completion)
{
return CommandBase.getListOfStringsMatchingLastWord(new String[]{arg}, unwrap(completion).collect(Collectors.toList()));
}
示例12: matchingAny
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
public static List<String> matchingAny(String arg, Object... suggest)
{
return CommandBase.getListOfStringsMatchingLastWord(new String[]{arg}, Arrays.asList(suggest));
}
示例13: getTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) {
return args.length == 1 ? CommandBase.getListOfStringsMatchingLastWord(args, server.getAllUsernames()) : null;
}
示例14: getTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) {
return args.length == 1 ? CommandBase.getListOfStringsMatchingLastWord(args, server.getAllUsernames()) : (args.length == 2 ? CommandBase.getListOfStringsMatchingLastWord(args,DeathInventoryHandler.getFilenames(args[0])) : null);
}
示例15: getTabCompletionOptions
import net.minecraft.command.CommandBase; //導入方法依賴的package包/類
@Override
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) {
return (args.length == 1 || args.length == 2) ? CommandBase.getListOfStringsMatchingLastWord(args, server.getAllUsernames()) : null;
}