本文整理匯總了Java中net.minecraft.util.EnumChatFormatting.RED屬性的典型用法代碼示例。如果您正苦於以下問題:Java EnumChatFormatting.RED屬性的具體用法?Java EnumChatFormatting.RED怎麽用?Java EnumChatFormatting.RED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類net.minecraft.util.EnumChatFormatting
的用法示例。
在下文中一共展示了EnumChatFormatting.RED屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: func_148311_a
protected String func_148311_a()
{
try
{
PackMetadataSection packmetadatasection = (PackMetadataSection)this.field_148320_d.getPackMetadata(this.mc.getResourcePackRepository().rprMetadataSerializer, "pack");
if (packmetadatasection != null)
{
return packmetadatasection.getPackDescription().getFormattedText();
}
}
catch (JsonParseException jsonparseexception)
{
logger.error((String)"Couldn\'t load metadata info", (Throwable)jsonparseexception);
}
catch (IOException ioexception)
{
logger.error((String)"Couldn\'t load metadata info", (Throwable)ioexception);
}
return EnumChatFormatting.RED + "Missing " + "pack.mcmeta" + " :(";
}
示例2: setMissionControlPort
/** Set the actual port used for mission control - not persisted, could be different each time the Mod is run.
* @param port the port currently in use for mission control.
*/
static public void setMissionControlPort(int port)
{
if (port != AddressHelper.missionControlPort)
{
AddressHelper.missionControlPort = port;
// Also update our metadata, for displaying to the user:
ModMetadata md = Loader.instance().activeModContainer().getMetadata();
if (port != -1)
md.description = "Talk to this Mod using port " + EnumChatFormatting.GREEN + port;
else
md.description = EnumChatFormatting.RED + "ERROR: No mission control port - check configuration";
// See if changing the port should lead to changing the login details:
//AuthenticationHelper.update(MalmoMod.instance.getModPermanentConfigFile());
}
}
示例3: run
@Override
public void run() {
status = "Logging in...";
final Session auth = createSession(account.getAuthName(), account.getAuthPassword());
if (auth == null) {
status = EnumChatFormatting.RED + "Failed.";
} else {
status = String.format(EnumChatFormatting.GREEN + "Success. (Logged in as %s.)", auth.getUsername());
if (account instanceof MigratedAccount) {
((MigratedAccount) account).setDisplay(auth.getUsername());
}
((MinecraftExtension) mc).setSession(auth);
}
}
示例4: drawCountDown
@Override
protected void drawCountDown(int secondsRemaining)
{
Map<String, String> data = new HashMap<String, String>();
String text = EnumChatFormatting.BOLD + "" + secondsRemaining + "...";
if (secondsRemaining <= 5)
text = EnumChatFormatting.RED + text;
data.put("chat", text);
MalmoMod.safeSendToAll(MalmoMessageType.SERVER_TEXT, data);
}
示例5: getTexturePackDescription
public String getTexturePackDescription()
{
return this.rePackMetadataSection == null ? EnumChatFormatting.RED + "Invalid pack.mcmeta (or missing \'pack\' section)" : this.rePackMetadataSection.getPackDescription().getFormattedText();
}
示例6: renderItemOverlayIntoGUI
/**
* Renders the stack size and/or damage bar for the given ItemStack.
*/
public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text)
{
if (stack != null)
{
if (stack.stackSize != 1 || text != null)
{
String s = text == null ? String.valueOf(stack.stackSize) : text;
if (text == null && stack.stackSize < 1)
{
s = EnumChatFormatting.RED + String.valueOf(stack.stackSize);
}
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableBlend();
fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), 16777215);
GlStateManager.enableLighting();
GlStateManager.enableDepth();
}
if (stack.isItemDamaged())
{
int j = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage());
int i = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableTexture2D();
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - i) / 4, 64, 0, 255);
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, j, 1, 255 - i, i, 0, 255);
GlStateManager.enableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.enableDepth();
}
}
}
示例7: drawSlot
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn)
{
IngestServer ingestserver = this.mc.getTwitchStream().func_152925_v()[entryID];
String s = ingestserver.serverUrl.replaceAll("\\{stream_key\\}", "");
String s1 = (int)ingestserver.bitrateKbps + " kbps";
String s2 = null;
IngestServerTester ingestservertester = this.mc.getTwitchStream().func_152932_y();
if (ingestservertester != null)
{
if (ingestserver == ingestservertester.func_153040_c())
{
s = EnumChatFormatting.GREEN + s;
s1 = (int)(ingestservertester.func_153030_h() * 100.0F) + "%";
}
else if (entryID < ingestservertester.func_153028_p())
{
if (ingestserver.bitrateKbps == 0.0F)
{
s1 = EnumChatFormatting.RED + "Down!";
}
}
else
{
s1 = EnumChatFormatting.OBFUSCATED + "1234" + EnumChatFormatting.RESET + " kbps";
}
}
else if (ingestserver.bitrateKbps == 0.0F)
{
s1 = EnumChatFormatting.RED + "Down!";
}
p_180791_2_ = p_180791_2_ - 15;
if (this.isSelected(entryID))
{
s2 = EnumChatFormatting.BLUE + "(Preferred)";
}
else if (ingestserver.defaultServer)
{
s2 = EnumChatFormatting.GREEN + "(Default)";
}
GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, ingestserver.serverName, p_180791_2_ + 2, p_180791_3_ + 5, 16777215);
GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s, p_180791_2_ + 2, p_180791_3_ + GuiIngestServers.this.fontRendererObj.FONT_HEIGHT + 5 + 3, 3158064);
GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s1, this.getScrollBarX() - 5 - GuiIngestServers.this.fontRendererObj.getStringWidth(s1), p_180791_3_ + 5, 8421504);
if (s2 != null)
{
GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s2, this.getScrollBarX() - 5 - GuiIngestServers.this.fontRendererObj.getStringWidth(s2), p_180791_3_ + 5 + 3 + GuiIngestServers.this.fontRendererObj.FONT_HEIGHT, 8421504);
}
}
示例8: renderScoreboard
private void renderScoreboard(ScoreObjective p_180475_1_, ScaledResolution p_180475_2_)
{
Scoreboard scoreboard = p_180475_1_.getScoreboard();
Collection<Score> collection = scoreboard.getSortedScores(p_180475_1_);
List<Score> list = Lists.newArrayList(Iterables.filter(collection, new Predicate<Score>()
{
public boolean apply(Score p_apply_1_)
{
return p_apply_1_.getPlayerName() != null && !p_apply_1_.getPlayerName().startsWith("#");
}
}));
if (list.size() > 15)
{
collection = Lists.newArrayList(Iterables.skip(list, collection.size() - 15));
}
else
{
collection = list;
}
int i = this.getFontRenderer().getStringWidth(p_180475_1_.getDisplayName());
for (Score score : collection)
{
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " + EnumChatFormatting.RED + score.getScorePoints();
i = Math.max(i, this.getFontRenderer().getStringWidth(s));
}
int i1 = collection.size() * this.getFontRenderer().FONT_HEIGHT;
int j1 = p_180475_2_.getScaledHeight() / 2 + i1 / 3;
int k1 = 3;
int l1 = p_180475_2_.getScaledWidth() - i - k1;
int j = 0;
for (Score score1 : collection)
{
++j;
ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName());
String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName());
String s2 = EnumChatFormatting.RED + "" + score1.getScorePoints();
int k = j1 - j * this.getFontRenderer().FONT_HEIGHT;
int l = p_180475_2_.getScaledWidth() - k1 + 2;
drawRect(l1 - 2, k, l, k + this.getFontRenderer().FONT_HEIGHT, 1342177280);
this.getFontRenderer().drawString(s1, l1, k, 553648127);
this.getFontRenderer().drawString(s2, l - this.getFontRenderer().getStringWidth(s2), k, 553648127);
if (j == collection.size())
{
String s3 = p_180475_1_.getDisplayName();
drawRect(l1 - 2, k - this.getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736);
drawRect(l1 - 2, k - 1, l, k, 1342177280);
this.getFontRenderer().drawString(s3, l1 + i / 2 - this.getFontRenderer().getStringWidth(s3) / 2, k - this.getFontRenderer().FONT_HEIGHT, 553648127);
}
}
}
示例9: getDebugInfoRight
protected List<String> getDebugInfoRight()
{
long i = Runtime.getRuntime().maxMemory();
long j = Runtime.getRuntime().totalMemory();
long k = Runtime.getRuntime().freeMemory();
long l = j - k;
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)});
if (this.isReducedDebug())
{
return list;
}
else
{
if (this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.mc.objectMouseOver.getBlockPos() != null)
{
BlockPos blockpos = this.mc.objectMouseOver.getBlockPos();
IBlockState iblockstate = this.mc.theWorld.getBlockState(blockpos);
if (this.mc.theWorld.getWorldType() != WorldType.DEBUG_WORLD)
{
iblockstate = iblockstate.getBlock().getActualState(iblockstate, this.mc.theWorld, blockpos);
}
list.add("");
list.add(String.valueOf(Block.blockRegistry.getNameForObject(iblockstate.getBlock())));
for (Entry<IProperty, Comparable> entry : iblockstate.getProperties().entrySet())
{
String s = ((Comparable)entry.getValue()).toString();
if (entry.getValue() == Boolean.TRUE)
{
s = EnumChatFormatting.GREEN + s;
}
else if (entry.getValue() == Boolean.FALSE)
{
s = EnumChatFormatting.RED + s;
}
list.add(((IProperty)entry.getKey()).getName() + ": " + s);
}
}
return list;
}
}
示例10: renderItemOverlayIntoGUI
/**
* Renders the stack size and/or damage bar for the given ItemStack.
*/
public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text)
{
if (stack != null)
{
if (stack.stackSize != 1 || text != null)
{
String s = text == null ? String.valueOf(stack.stackSize) : text;
if (text == null && stack.stackSize < 1)
{
s = EnumChatFormatting.RED + String.valueOf(stack.stackSize);
}
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableBlend();
fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), 16777215);
GlStateManager.enableLighting();
GlStateManager.enableDepth();
}
boolean flag = stack.isItemDamaged();
if (Reflector.ForgeItem_showDurabilityBar.exists())
{
flag = Reflector.callBoolean(stack.getItem(), Reflector.ForgeItem_showDurabilityBar, new Object[] {stack});
}
if (flag)
{
int i = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage());
int j = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());
if (Reflector.ForgeItem_getDurabilityForDisplay.exists())
{
double d0 = Reflector.callDouble(stack.getItem(), Reflector.ForgeItem_getDurabilityForDisplay, new Object[] {stack});
i = (int)Math.round(13.0D - d0 * 13.0D);
j = (int)Math.round(255.0D - d0 * 255.0D);
}
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableTexture2D();
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - j) / 4, 64, 0, 255);
this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, i, 1, 255 - j, j, 0, 255);
if (!Reflector.ForgeHooksClient.exists())
{
GlStateManager.enableBlend();
}
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.enableDepth();
}
}
}
示例11: getWailaBody
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
Block block = accessor.getBlock();
if(block == ModBlocks.WoodenPressWet) {
// NBTTagCompound tagCompound = accessor.getNBTData();
// int md = tagCompound.getInteger("metadata");
String tip = (accessor.getMetadata() == 0 ? (EnumChatFormatting.RED + "Wait until dry")
: (EnumChatFormatting.GREEN + "Break to obtain paper"));
currenttip.add(tip);
}
return currenttip;
}