本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例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());
}
示例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();
}
}
}
示例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));
}
示例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.");
}
}
示例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);
}
}
示例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));
}