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


Java ChatMessageComponent.createFromText方法代码示例

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


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

示例1: onPlayerLogin

import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
@Override
public void onPlayerLogin(EntityPlayer player) {
	JsonRootNode response = MineticketAPI.registerUser(player.getCommandSenderName());

	if (response.isStringValue("account_status")) {
		if (response.getStringValue("account_status").equals("unactivated")) {
			ChatMessageComponent chat = ChatMessageComponent
					.createFromText("[MineTicket] "
							+ "Your account is unactivated. "
							+ "You can activate by using the \"/mineticket activate <email>\" command, "
							+ "or by using the following activation key on the MineTicket website: "
							+ response.getStringValue("activation_key"));

			player.sendChatToPlayer(chat);
		}
	}
}
 
开发者ID:schlarpc,项目名称:MineTicketForge,代码行数:18,代码来源:MineticketPlayer.java

示例2: sendMessageToTeam

import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public void sendMessageToTeam(String message) {
	ChatMessageComponent comp = ChatMessageComponent.createFromText(message);
	
	for(EntityPlayerMP player : member.values()) {
		player.sendChatToPlayer(comp);
	}
}
 
开发者ID:becelot,项目名称:TeamCore,代码行数:8,代码来源:Team.java

示例3: getDeathMessage

import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
@Override
public ChatMessageComponent getDeathMessage(EntityLivingBase entity)
   {
       return ChatMessageComponent.createFromText("");
   }
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:6,代码来源:DamageSourceAP.java

示例4: actionPerformed

import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
/**
 * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
 */
protected void actionPerformed(GuiButton par1GuiButton)
{
    if (par1GuiButton.id == 102)
    {
        this.mc.displayGuiScreen(this.parentScreen);
    }
    else if (par1GuiButton.id == 104)
    {
        if (this.gameMode.equals("survival"))
        {
            this.gameMode = "creative";
        }
        else if (this.gameMode.equals("creative"))
        {
            this.gameMode = "adventure";
        }
        else
        {
            this.gameMode = "survival";
        }

        this.func_74088_g();
    }
    else if (par1GuiButton.id == 103)
    {
        this.allowCommands = !this.allowCommands;
        this.func_74088_g();
    }
    else if (par1GuiButton.id == 101)
    {
        this.mc.displayGuiScreen((GuiScreen)null);
        String s = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.gameMode), this.allowCommands);
        ChatMessageComponent chatmessagecomponent;

        if (s != null)
        {
            chatmessagecomponent = ChatMessageComponent.createFromTranslationWithSubstitutions("commands.publish.started", new Object[] {s});
        }
        else
        {
            chatmessagecomponent = ChatMessageComponent.createFromText("commands.publish.failed");
        }

        this.mc.ingameGUI.getChatGUI().printChatMessage(chatmessagecomponent.toStringWithFormatting(true));
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:50,代码来源:GuiShareToLan.java

示例5: fromRegistry

import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public static ChatMessageComponent fromRegistry(String registry) {
	return ChatMessageComponent.createFromText(StatCollector.translateToLocal(registry));
}
 
开发者ID:becelot,项目名称:TeamCore,代码行数:4,代码来源:Chat.java

示例6: fromRegistryFormatted

import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public static ChatMessageComponent fromRegistryFormatted(String registry, Object... args) {
	return ChatMessageComponent.createFromText(StatCollector.translateToLocalFormatted(registry, args));
}
 
开发者ID:becelot,项目名称:TeamCore,代码行数:4,代码来源:Chat.java


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