當前位置: 首頁>>代碼示例>>Java>>正文


Java CommandBase.getListOfStringsMatchingLastWord方法代碼示例

本文整理匯總了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);
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:30,代碼來源:GuiXrayPendantScreen.java

示例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);
}
 
開發者ID:abused,項目名稱:World-Border,代碼行數:9,代碼來源:WBCommand.java

示例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;
}
 
開發者ID:M4thG33k,項目名稱:TombManyGraves,代碼行數:9,代碼來源:CommandRemoveFriend.java

示例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);
}
 
開發者ID:RoyCurtis,項目名稱:WorldBorder-Forge,代碼行數:10,代碼來源:WBCommand.java

示例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;
	}
}
 
開發者ID:notabadminer,項目名稱:UniversalCoins,代碼行數:16,代碼來源:TilePackager.java

示例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;
}
 
開發者ID:brandon3055,項目名稱:Town-Builder,代碼行數:9,代碼來源:CommandPaste.java

示例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;
}
 
開發者ID:brandon3055,項目名稱:Town-Builder,代碼行數:9,代碼來源:CommandDelete.java

示例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();
}
 
開發者ID:PrinceOfAmber,項目名稱:Cyclic,代碼行數:8,代碼來源:BaseCommand.java

示例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;
	}
}
 
開發者ID:coolAlias,項目名稱:ZeldaSwordSkills,代碼行數:10,代碼來源:CommandSetMagic.java

示例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());
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:7,代碼來源:HarshenCastleCommands.java

示例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()));
}
 
開發者ID:Ivorforce,項目名稱:MCOpts,代碼行數:5,代碼來源:Expect.java

示例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));
}
 
開發者ID:Ivorforce,項目名稱:MCOpts,代碼行數:5,代碼來源:Expect.java

示例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;
}
 
開發者ID:M4thG33k,項目名稱:TombManyGraves,代碼行數:5,代碼來源:CommandFriend.java

示例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);
}
 
開發者ID:M4thG33k,項目名稱:TombManyGraves,代碼行數:5,代碼來源:CommandDropInventory.java

示例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;
}
 
開發者ID:M4thG33k,項目名稱:TombManyGraves,代碼行數:5,代碼來源:CommandLoot.java


注:本文中的net.minecraft.command.CommandBase.getListOfStringsMatchingLastWord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。