當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumChatFormatting類代碼示例

本文整理匯總了Java中net.minecraft.util.EnumChatFormatting的典型用法代碼示例。如果您正苦於以下問題:Java EnumChatFormatting類的具體用法?Java EnumChatFormatting怎麽用?Java EnumChatFormatting使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EnumChatFormatting類屬於net.minecraft.util包,在下文中一共展示了EnumChatFormatting類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	super.addInformation(stack, player, list, par4);

	if (player.capabilities.isCreativeMode)
	{
		list.add(EnumChatFormatting.BLUE + "Quiver: INFINITE / " + this.getMaxDamage() + " Arrows");
	}
	else
	{
		int ammo = this.getMaxDamage() - this.getDamage(stack);
		list.add(EnumChatFormatting.BLUE + "Quiver: " + ammo + " / " + this.getMaxDamage() + " Arrows");
	}

	list.add(EnumChatFormatting.GREEN + "Holds more Arrows.");

	list.add("Craft with up to 8 arrow bundles to reload.");
	list.add("A quiver has been sewn to this bow.");
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:22,代碼來源:QuiverBow.java

示例2: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	super.addInformation(stack, player, list, par4);

	if (player.capabilities.isCreativeMode)
	{
		list.add(EnumChatFormatting.BLUE + "Bolts: INFINITE / " + this.getMaxDamage());
	}
	else
	{
		int ammo = this.getMaxDamage() - this.getDamage(stack);
		list.add(EnumChatFormatting.BLUE + "Bolts: " + ammo + " / " + this.getMaxDamage());
	}

	list.add(EnumChatFormatting.BLUE + "Damage: " + this.DmgMin + " - " + this.DmgMax);
	list.add(EnumChatFormatting.GREEN + "Knockback " + this.Knockback + " on hit.");
	list.add(EnumChatFormatting.RED + "Cooldown for " + this.displayInSec(this.Cooldown) + " sec on use.");
	list.add(EnumChatFormatting.YELLOW + "Craft with 1 or 2 Arrows to reload.");
	list.add("A sticky piston powers the");
	list.add("reloading mechanism.");

	if (this.getCooldown(stack) != 0) {list.add(EnumChatFormatting.RED + "RE-TAUTING! (" + this.getCooldown(stack) + ")"); }
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:26,代碼來源:Crossbow_Double.java

示例3: onDisconnect

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination
 */
public void onDisconnect(IChatComponent reason)
{
    logger.info(this.playerEntity.getName() + " lost connection: " + reason);
    this.serverController.refreshStatusNextTick();
    ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.left", new Object[] {this.playerEntity.getDisplayName()});
    chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW);
    this.serverController.getConfigurationManager().sendChatMsg(chatcomponenttranslation);
    this.playerEntity.mountEntityAndWakeUp();
    this.serverController.getConfigurationManager().playerLoggedOut(this.playerEntity);

    if (this.serverController.isSinglePlayer() && this.playerEntity.getName().equals(this.serverController.getServerOwner()))
    {
        logger.info("Stopping singleplayer server as player logged out");
        this.serverController.initiateShutdown();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:NetHandlerPlayServer.java

示例4: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	super.addInformation(stack, player, list, par4);

	if (player.capabilities.isCreativeMode)
	{
		list.add(EnumChatFormatting.BLUE + "Gold Nuggets: INFINITE / " + this.getMaxDamage());
	}
	else
	{
		int ammo = this.getMaxDamage() - this.getDamage(stack);
		list.add(EnumChatFormatting.BLUE + "Gold Nuggets: " + ammo + " / " + this.getMaxDamage());
	}

	list.add(EnumChatFormatting.BLUE + "Damage: " + this.DmgMin + " - " + this.DmgMax + " per Nugget");
	list.add(EnumChatFormatting.GREEN + "Scatter 9 when firing.");
	list.add(EnumChatFormatting.RED + "Cooldown for " + this.displayInSec(this.Cooldown) + " sec on use.");
	list.add(EnumChatFormatting.YELLOW + "Crouch-use to drop the current magazine.");
	list.add(EnumChatFormatting.YELLOW + "Craft with a Gold Magazine to reload.");
	list.add("Spring-loaded. It's pretty heavy.");
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:24,代碼來源:CoinTosser.java

示例5: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	super.addInformation(stack, player, list, par4);

	if (player.capabilities.isCreativeMode)
	{
		list.add(EnumChatFormatting.BLUE + "Rods: INFINITE / " + this.getMaxDamage());
	}
	else
	{
		int ammo = this.getMaxDamage() - this.getDamage(stack);
		list.add(EnumChatFormatting.BLUE + "Rods: " + ammo + " / " + this.getMaxDamage());
	}

	list.add(EnumChatFormatting.BLUE + "Damage: " + this.DmgMin + " - " + this.DmgMax);
	list.add(EnumChatFormatting.GREEN + "Fire for " + this.FireDur + " sec on hit.");
	list.add(EnumChatFormatting.GREEN + "Knockback " + this.Knockback + " on hit.");
	list.add(EnumChatFormatting.YELLOW + "Craft with 1 Blaze Rod to reload.");
	list.add("Black smoke is slowly curling up from it.");
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:23,代碼來源:Crossbow_Blaze.java

示例6: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	super.addInformation(stack, player, list, par4);

	if (player.capabilities.isCreativeMode)
	{
		list.add(EnumChatFormatting.BLUE + "Bolts: INFINITE / " + this.getMaxDamage());
	}
	else
	{
		int ammo = this.getMaxDamage() - this.getDamage(stack);
		list.add(EnumChatFormatting.BLUE + "Bolts: " + ammo + " / " + this.getMaxDamage());
	}

	list.add(EnumChatFormatting.BLUE + "Damage: " + this.DmgMin + " - " + this.DmgMax);
	list.add(EnumChatFormatting.GREEN + "Knockback " + this.Knockback + " on hit.");
	list.add(EnumChatFormatting.YELLOW + "Craft with 1 Arrow to reload.");
	list.add("A simple yet effective design.");
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:22,代碼來源:Crossbow_Compact.java

示例7: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	super.addInformation(stack, player, list, par4);

	if (player.capabilities.isCreativeMode)
	{
		list.add(EnumChatFormatting.BLUE + "Bolts: INFINITE / " + this.getMaxDamage());
	}
	else
	{
		int ammo = this.getMaxDamage() - this.getDamage(stack);
		list.add(EnumChatFormatting.BLUE + "Bolts: " + ammo + " / " + this.getMaxDamage());
	}

	list.add(EnumChatFormatting.BLUE + "Damage: " + this.DmgMin + " - " + this.DmgMax);
	list.add(EnumChatFormatting.GREEN + "Knockback " + this.Knockback + " on hit.");
	list.add(EnumChatFormatting.YELLOW + "Craft with up to 2 Arrow");
	list.add(EnumChatFormatting.YELLOW + "Bundles to reload.");
	list.add("Features a new and");
	list.add("improved bolt feeder.");
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:24,代碼來源:Crossbow_AutoImp.java

示例8: func_152892_c

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
public void func_152892_c(ErrorCode p_152892_1_)
{
    if (p_152892_1_ == ErrorCode.TTV_EC_SOUNDFLOWER_NOT_INSTALLED)
    {
        IChatComponent ichatcomponent = new ChatComponentTranslation("stream.unavailable.soundflower.chat.link", new Object[0]);
        ichatcomponent.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://help.mojang.com/customer/portal/articles/1374877-configuring-soundflower-for-streaming-on-apple-computers"));
        ichatcomponent.getChatStyle().setUnderlined(Boolean.valueOf(true));
        IChatComponent ichatcomponent1 = new ChatComponentTranslation("stream.unavailable.soundflower.chat", new Object[] {ichatcomponent});
        ichatcomponent1.getChatStyle().setColor(EnumChatFormatting.DARK_RED);
        this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent1);
    }
    else
    {
        IChatComponent ichatcomponent2 = new ChatComponentTranslation("stream.unavailable.unknown.chat", new Object[] {ErrorCode.getString(p_152892_1_)});
        ichatcomponent2.getChatStyle().setColor(EnumChatFormatting.DARK_RED);
        this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent2);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:TwitchStream.java

示例9: listObjectives

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
protected void listObjectives(ICommandSender p_147196_1_) throws CommandException
{
    Scoreboard scoreboard = this.getScoreboard();
    Collection<ScoreObjective> collection = scoreboard.getScoreObjectives();

    if (collection.size() <= 0)
    {
        throw new CommandException("commands.scoreboard.objectives.list.empty", new Object[0]);
    }
    else
    {
        ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.objectives.list.count", new Object[] {Integer.valueOf(collection.size())});
        chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN);
        p_147196_1_.addChatMessage(chatcomponenttranslation);

        for (ScoreObjective scoreobjective : collection)
        {
            p_147196_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.objectives.list.entry", new Object[] {scoreobjective.getName(), scoreobjective.getDisplayName(), scoreobjective.getCriteria().getName()}));
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:CommandScoreboard.java

示例10: renderToolTip

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
protected void renderToolTip(ItemStack stack, int x, int y)
{
    List<String> list = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);

    for (int i = 0; i < list.size(); ++i)
    {
        if (i == 0)
        {
            list.set(i, stack.getRarity().rarityColor + (String)list.get(i));
        }
        else
        {
            list.set(i, EnumChatFormatting.GRAY + (String)list.get(i));
        }
    }

    this.drawHoveringText(list, x, y);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:GuiScreen.java

示例11: drawScreen

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792);
    GlStateManager.pushMatrix();
    GlStateManager.scale(2.0F, 2.0F, 2.0F);
    boolean flag = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled();
    String s = flag ? I18n.format("deathScreen.title.hardcore", new Object[0]) : I18n.format("deathScreen.title", new Object[0]);
    this.drawCenteredString(this.fontRendererObj, s, this.width / 2 / 2, 30, 16777215);
    GlStateManager.popMatrix();

    if (flag)
    {
        this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.hardcoreInfo", new Object[0]), this.width / 2, 144, 16777215);
    }

    this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.score", new Object[0]) + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215);
    super.drawScreen(mouseX, mouseY, partialTicks);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:GuiGameOver.java

示例12: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
    super.addInformation(stack, player, list, par4);
    
    int ammo = this.getMaxDamage() - this.getDamage(stack);
    
    list.add(EnumChatFormatting.BLUE + "Durability: " + ammo + " / " + this.getMaxDamage());
    
    list.add(EnumChatFormatting.GREEN + "Zoom on use.");
    list.add(EnumChatFormatting.GREEN + "Predictive arrow on use.");
    
    list.add("An ender-eye scope is attached.");
    list.add("It's staring at you.");
   }
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:17,代碼來源:EnderBow.java

示例13: addInformation

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
/**
 * allows items to add custom lines of information to the mouseover description
 */
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
    if (stack.hasTagCompound())
    {
        NBTTagCompound nbttagcompound = stack.getTagCompound();
        String s = nbttagcompound.getString("author");

        if (!StringUtils.isNullOrEmpty(s))
        {
            tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {s}));
        }

        tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("book.generation." + nbttagcompound.getInteger("generation")));
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:ItemEditableBook.java

示例14: tellOwnerAboutAmmo

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
public static void tellOwnerAboutAmmo(Entity_AA turret, boolean secondRail)
{
	// Is empty, so telling the owner about this
	EntityPlayer owner = turret.worldObj.getPlayerEntityByName(turret.ownerName);

	if (owner == null) { return; }	// Might not be online right now
	
	// My name
	String turretName = "[ARMS ASSISTANT " + turret.getEntityId() + "]";
	if (turret.getCustomNameTag() != null && !turret.getCustomNameTag().isEmpty()) { turretName = "[" + turret.getCustomNameTag() + "]"; }

	if (secondRail)
	{
		owner.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + turretName + ": Second rail is out of ammunition."));
	}
	else
	{
		owner.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + turretName + ": First rail is out of ammunition."));
	}
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:21,代碼來源:AI_Communication.java

示例15: rotateCorpse

import net.minecraft.util.EnumChatFormatting; //導入依賴的package包/類
protected void rotateCorpse(T bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);

    if (bat.deathTime > 0)
    {
        float f = ((float)bat.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f = MathHelper.sqrt_float(f);

        if (f > 1.0F)
        {
            f = 1.0F;
        }

        GlStateManager.rotate(f * this.getDeathMaxRotation(bat), 0.0F, 0.0F, 1.0F);
    }
    else
    {
        String s = EnumChatFormatting.getTextWithoutFormattingCodes(bat.getName());

        if (s != null && (s.equals("Dinnerbone") || s.equals("Grumm")) && (!(bat instanceof EntityPlayer) || ((EntityPlayer)bat).isWearing(EnumPlayerModelParts.CAPE)))
        {
            GlStateManager.translate(0.0F, bat.height + 0.1F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:28,代碼來源:RendererLivingEntity.java


注:本文中的net.minecraft.util.EnumChatFormatting類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。