本文整理汇总了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.");
}
示例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) + ")"); }
}
示例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();
}
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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);
}
}
示例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()}));
}
}
}
示例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);
}
示例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);
}
示例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.");
}
示例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")));
}
}
示例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."));
}
}
示例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);
}
}
}