當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。