本文整理汇总了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);
}
}
}
示例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);
}
}
示例3: getDeathMessage
import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
@Override
public ChatMessageComponent getDeathMessage(EntityLivingBase entity)
{
return ChatMessageComponent.createFromText("");
}
示例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));
}
}
示例5: fromRegistry
import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public static ChatMessageComponent fromRegistry(String registry) {
return ChatMessageComponent.createFromText(StatCollector.translateToLocal(registry));
}
示例6: fromRegistryFormatted
import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public static ChatMessageComponent fromRegistryFormatted(String registry, Object... args) {
return ChatMessageComponent.createFromText(StatCollector.translateToLocalFormatted(registry, args));
}