当前位置: 首页>>代码示例>>Java>>正文


Java ChatAllowedCharacters.allowedCharactersArray方法代码示例

本文整理汇总了Java中net.minecraft.util.ChatAllowedCharacters.allowedCharactersArray方法的典型用法代码示例。如果您正苦于以下问题:Java ChatAllowedCharacters.allowedCharactersArray方法的具体用法?Java ChatAllowedCharacters.allowedCharactersArray怎么用?Java ChatAllowedCharacters.allowedCharactersArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.util.ChatAllowedCharacters的用法示例。


在下文中一共展示了ChatAllowedCharacters.allowedCharactersArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_146314_g

import net.minecraft.util.ChatAllowedCharacters; //导入方法依赖的package包/类
private void func_146314_g()
{
    this.field_146336_i = this.field_146333_g.getText().trim();

    for (char c0 : ChatAllowedCharacters.allowedCharactersArray)
    {
        this.field_146336_i = this.field_146336_i.replace(c0, '_');
    }

    if (StringUtils.isEmpty(this.field_146336_i))
    {
        this.field_146336_i = "World";
    }

    this.field_146336_i = func_146317_a(this.mc.getSaveLoader(), this.field_146336_i);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:GuiCreateWorld.java

示例2: makeUseableName

import net.minecraft.util.ChatAllowedCharacters; //导入方法依赖的package包/类
/**
 * Makes a the name for a world save folder based on your world name, replacing specific characters for _s and
 * appending -s to the end until a free name is available.
 */
private void makeUseableName()
{
    this.folderName = this.textboxWorldName.getText().trim();
    char[] achar = ChatAllowedCharacters.allowedCharactersArray;
    int i = achar.length;

    for (int j = 0; j < i; ++j)
    {
        char c0 = achar[j];
        this.folderName = this.folderName.replace(c0, '_');
    }

    if (MathHelper.stringNullOrLengthZero(this.folderName))
    {
        this.folderName = "World";
    }

    this.folderName = func_73913_a(this.mc.getSaveLoader(), this.folderName);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:24,代码来源:GuiCreateWorld.java

示例3: makeUseableName

import net.minecraft.util.ChatAllowedCharacters; //导入方法依赖的package包/类
/**
 * Makes a the name for a world save folder based on your world name, replacing specific characters for _s and
 * appending -s to the end until a free name is available.
 */
private void makeUseableName()
{
	this.folderName = this.textboxWorldName.getText().trim();

	for (char c0 : ChatAllowedCharacters.allowedCharactersArray)
	{
		this.folderName = this.folderName.replace(c0, '_');
	}

	if (MathHelper.stringNullOrLengthZero(this.folderName))
	{
		this.folderName = "World";
	}

	this.folderName = func_73913_a(this.mc.getSaveLoader(), this.folderName);
}
 
开发者ID:Ubiquitous-Spice,项目名称:Modjam-3,代码行数:21,代码来源:HackedCreateWorld.java

示例4: getCurrentWorldName

import net.minecraft.util.ChatAllowedCharacters; //导入方法依赖的package包/类
public String getCurrentWorldName() {
	Minecraft mc = Minecraft.getMinecraft();
	EntityPlayerSP player = mc.thePlayer;
	NetHandlerPlayClient handler = player.sendQueue;
	NetworkManager netManager = handler.getNetworkManager();
	SocketAddress addr = netManager == null ? null : netManager.getRemoteAddress();
	if(addr == null)
		return null;
	String addrStr = addr.toString().replaceAll("[\r\n]", "");
       Matcher matcher = Pattern.compile("(.*)/(.*):([0-9]+)").matcher(addrStr);
       
       String levelName = "";
       
	if (matcher.matches()) {
		levelName = matcher.group(1);
		if (levelName.isEmpty()) {
			levelName = matcher.group(2);
		}
		if (!matcher.group(3).equals("25565")) {
			levelName = levelName + "[" + matcher.group(3) + "]";
		}
	} else {
		String str = addr.toString().replaceAll("[a-z]", "a").replaceAll("[A-Z]", "A").replaceAll("[0-9]", "*");
	}

	for (char c : ChatAllowedCharacters.allowedCharactersArray) {
		levelName = levelName.replace(c, '_');
	}
	return levelName;
}
 
开发者ID:unknownloner,项目名称:HeroMod,代码行数:31,代码来源:Minimap.java


注:本文中的net.minecraft.util.ChatAllowedCharacters.allowedCharactersArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。