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


Java StringUtils.stripControlCodes方法代碼示例

本文整理匯總了Java中net.minecraft.util.StringUtils.stripControlCodes方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.stripControlCodes方法的具體用法?Java StringUtils.stripControlCodes怎麽用?Java StringUtils.stripControlCodes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.StringUtils的用法示例。


在下文中一共展示了StringUtils.stripControlCodes方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onEnable

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
@Override
public void onEnable()
{
	index = 0;
	timer = -1;
	players.clear();
	
	for(NetworkPlayerInfo info : WMinecraft.getConnection()
		.getPlayerInfoMap())
	{
		String name = info.getPlayerNameForReal();
		name = StringUtils.stripControlCodes(name);
		
		if(name.equals(WMinecraft.getPlayer().getName()))
			continue;
		
		players.add(name);
	}
	Collections.shuffle(players, random);
	
	wurst.events.add(ChatInputListener.class, this);
	wurst.events.add(UpdateListener.class, this);
	
	if(players.isEmpty())
	{
		ChatUtils.error("Couldn't find any players.");
		setEnabled(false);
	}
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-MC-1.12,代碼行數:30,代碼來源:MassTpaMod.java

示例2: AbstractClientPlayer

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
public AbstractClientPlayer(World worldIn, GameProfile playerProfile)
{
    super(worldIn, playerProfile);
    this.nameClear = playerProfile.getName();

    if (this.nameClear != null && !this.nameClear.isEmpty())
    {
        this.nameClear = StringUtils.stripControlCodes(this.nameClear);
    }

    CapeUtils.downloadCape(this);
    PlayerConfigurations.getPlayerConfiguration(this);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:14,代碼來源:AbstractClientPlayer.java

示例3: getPlayerName

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
public static String getPlayerName(AbstractClientPlayer p_getPlayerName_0_)
{
    String s = p_getPlayerName_0_.getName();

    if (s != null && !s.isEmpty())
    {
        s = StringUtils.stripControlCodes(s);
    }

    return s;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:12,代碼來源:PlayerConfigurations.java

示例4: AbstractClientPlayer

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
public AbstractClientPlayer(World worldIn, GameProfile playerProfile) {
  super(worldIn, playerProfile);
  this.nameClear = playerProfile.getName();

  if (this.nameClear != null && !this.nameClear.isEmpty()) {
    this.nameClear = StringUtils.stripControlCodes(this.nameClear);
  }

  //CapeUtils.downloadCape(this); // Optifine capes
  PlayerConfigurations.getPlayerConfiguration(this);

  CapesAPI.loadCape(playerProfile.getId());
}
 
開發者ID:halfpetal,項目名稱:CapesAPI-ClientImplementation,代碼行數:14,代碼來源:AbstractClientPlayer.java

示例5: drawSlot

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
@Override
protected void drawSlot(int idx, int right, int top, int height, Tessellator tess)
{
    ModContainer mc       = mods.get(idx);
    String       name     = StringUtils.stripControlCodes(mc.getName());
    String       version  = StringUtils.stripControlCodes(mc.getDisplayVersion());
    FontRenderer font     = this.parent.getFontRenderer();
    CheckResult  vercheck = ForgeVersion.getResult(mc);

    if (Loader.instance().getModState(mc) == ModState.DISABLED)
    {
        font.drawString(font.trimStringToWidth(name,       listWidth - 10), this.left + 3 , top +  2, 0xFF2222);
        font.drawString(font.trimStringToWidth(version,    listWidth - (5 + height)), this.left + 3 , top + 12, 0xFF2222);
        font.drawString(font.trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , top + 22, 0xFF2222);
    }
    else
    {
        font.drawString(font.trimStringToWidth(name,    listWidth - 10), this.left + 3 , top +  2, 0xFFFFFF);
        font.drawString(font.trimStringToWidth(version, listWidth - (5 + height)), this.left + 3 , top + 12, 0xCCCCCC);
        font.drawString(font.trimStringToWidth(mc.getMetadata() != null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , top + 22, 0xCCCCCC);

        if (vercheck.status.shouldDraw())
        {
            //TODO: Consider adding more icons for visualization
            Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
            GlStateManager.color(1, 1, 1, 1);
            GlStateManager.pushMatrix();
            Gui.drawModalRectWithCustomSizedTexture(right - (height / 2 + 4), top + (height / 2 - 4), vercheck.status.getSheetOffset() * 8, (vercheck.status.isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
            GlStateManager.popMatrix();
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:33,代碼來源:GuiSlotModList.java

示例6: getLocationSkin

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
/**
 * Returns true if the username has an associated skin.
 */
public static ResourceLocation getLocationSkin(String username)
{
    return new ResourceLocation("skins/" + StringUtils.stripControlCodes(username));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:8,代碼來源:AbstractClientPlayer.java

示例7: call

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
@Override
public void call(String[] args) throws CmdException
{
	if(args.length != 1)
		throw new CmdSyntaxError();
	
	if(args[0].equals("all"))
	{
		int alts = 0;
		for(NetworkPlayerInfo info : WMinecraft.getConnection()
			.getPlayerInfoMap())
		{
			String name =
				StringUtils.stripControlCodes(info.getPlayerNameForReal());
			
			if(name.equals(WMinecraft.getPlayer().getName())
				|| name.equals("Alexander01998")
				|| GuiAltList.alts.contains(new Alt(name, null, null)))
				continue;
			
			GuiAltList.alts.add(new Alt(name, null, null));
			alts++;
		}
		
		if(alts == 1)
			ChatUtils.message("Added 1 alt.");
		else
			ChatUtils.message("Added " + alts + " alts.");
		
		GuiAltList.sortAlts();
		ConfigFiles.ALTS.save();
		
	}else if(!args[0].equals("Alexander01998"))
	{
		GuiAltList.alts.add(new Alt(args[0], null, null));
		
		GuiAltList.sortAlts();
		ConfigFiles.ALTS.save();
		
		ChatUtils.message("Added 1 alt.");
	}
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-MC-1.12,代碼行數:43,代碼來源:AddAltCmd.java

示例8: downloadCape

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
private void downloadCape(String p_downloadCape_1_)
{
    if (p_downloadCape_1_ != null && !p_downloadCape_1_.isEmpty())
    {
        p_downloadCape_1_ = StringUtils.stripControlCodes(p_downloadCape_1_);
        String s = "http://s.optifine.net/capes/" + p_downloadCape_1_ + ".png";
        String s1 = FilenameUtils.getBaseName(s);
        final ResourceLocation resourcelocation = new ResourceLocation("capeof/" + s1);
        TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
        ITextureObject itextureobject = texturemanager.getTexture(resourcelocation);

        if (itextureobject != null && itextureobject instanceof ThreadDownloadImageData)
        {
            ThreadDownloadImageData threaddownloadimagedata = (ThreadDownloadImageData)itextureobject;

            if (threaddownloadimagedata.imageFound != null)
            {
                if (threaddownloadimagedata.imageFound.booleanValue())
                {
                    this.ofLocationCape = resourcelocation;
                }

                return;
            }
        }

        IImageBuffer iimagebuffer = new IImageBuffer()
        {
            ImageBufferDownload ibd = new ImageBufferDownload();
            public BufferedImage parseUserSkin(BufferedImage image)
            {
                return AbstractClientPlayer.this.parseCape(image);
            }
            public void skinAvailable()
            {
                AbstractClientPlayer.this.ofLocationCape = resourcelocation;
            }
        };
        ThreadDownloadImageData threaddownloadimagedata1 = new ThreadDownloadImageData((File)null, s, (ResourceLocation)null, iimagebuffer);
        texturemanager.loadTexture(resourcelocation, threaddownloadimagedata1);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:43,代碼來源:AbstractClientPlayer.java

示例9: getLocationSkin

import net.minecraft.util.StringUtils; //導入方法依賴的package包/類
/**
 * Returns true if the username has an associated skin.
 */
public static ResourceLocation getLocationSkin(String username) {
  return new ResourceLocation("skins/" + StringUtils.stripControlCodes(username));
}
 
開發者ID:halfpetal,項目名稱:CapesAPI-ClientImplementation,代碼行數:7,代碼來源:AbstractClientPlayer.java


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