Java Code Examples for net.minecraft.util.EnumChatFormatting#RED
The following examples show how to use
net.minecraft.util.EnumChatFormatting#RED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GT_TileEntity_MegaBlastFurnace.java From bartworks with MIT License | 6 votes |
public String[] getInfoData() { int mPollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler e : this.mMufflerHatches) if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(e)) mPollutionReduction = Math.max(e.calculatePollutionReduction(this.mPollution), mPollutionReduction); long storedEnergy = 0L; long maxEnergy = 0L; if (LoaderReference.tectech) { long[] info = getCurrentInfoData(); storedEnergy = info[0]; maxEnergy = info[1]; } for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) { if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; }
Example 2
Source File: GT_MetaTileEntity_AirFilter.java From NewHorizonsCoreMod with GNU General Public License v3.0 | 6 votes |
@Override public String[] getInfoData() { return new String[]{ "Progress:", EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s", "Stored Energy:", EnumChatFormatting.GREEN + Long.toString(getBaseMetaTileEntity().getStoredEU()) + EnumChatFormatting.RESET +" EU / "+ EnumChatFormatting.YELLOW + Long.toString(getBaseMetaTileEntity().getEUCapacity()) + EnumChatFormatting.RESET +" EU", "Probably uses: "+ EnumChatFormatting.RED + Integer.toString(mEUt) + EnumChatFormatting.RESET + " EU/t", "Max Energy Income: "+ EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t(*2A) Tier: "+ EnumChatFormatting.YELLOW+VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET, "Problems: "+ EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ " Efficiency: "+ EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %", "Pollution reduction: "+ EnumChatFormatting.GREEN + mPollutionReduction/60 + EnumChatFormatting.RESET+" gibbl/s" }; }
Example 3
Source File: NEIModContainer.java From NotEnoughItems with MIT License | 6 votes |
@Override public ModMetadata getMetadata() { String s_plugins = ""; if (plugins.size() == 0) { s_plugins += EnumChatFormatting.RED+"No installed plugins."; } else { s_plugins += EnumChatFormatting.GREEN+"Installed plugins: "; for (int i = 0; i < plugins.size(); i++) { if (i > 0) s_plugins += ", "; IConfigureNEI plugin = plugins.get(i); s_plugins += plugin.getName() + " " + plugin.getVersion(); } s_plugins += "."; } ModMetadata meta = super.getMetadata(); meta.description = description.replace("<plugins>", s_plugins); return meta; }
Example 4
Source File: GuiKeyBindingList.java From ehacks-pro with GNU General Public License v3.0 | 5 votes |
@Override public void drawEntry(int index, int x, int y, int width, int height, Tessellator tesselator, int buttonX, int buttonY, boolean p_148279_9_) { boolean var10 = GuiKeyBindingList.this.parentScreen.currentKeyBinding == this.entryKeybinding; GuiKeyBindingList.this.mc.fontRenderer.drawString(this.keyDesctiption, x + 90 - GuiKeyBindingList.this.maxListLabelWidth, y + height / 2 - GuiKeyBindingList.this.mc.fontRenderer.FONT_HEIGHT / 2, 16777215); this.btnReset.xPosition = x + 190; this.btnReset.yPosition = y; this.btnReset.enabled = this.entryKeybinding.getKeyCode() != this.entryKeybinding.getKeyCodeDefault(); this.btnReset.drawButton(GuiKeyBindingList.this.mc, buttonX, buttonY); this.btnChangeKeyBinding.xPosition = x + 105; this.btnChangeKeyBinding.yPosition = y; this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.entryKeybinding.getKeyCode()); boolean var11 = false; if (this.entryKeybinding.getKeyCode() != 0) { ModuleKeyBinding[] var12 = GuiKeyBindingList.this.parentScreen.keyBindings; int var13 = var12.length; for (int var14 = 0; var14 < var13; ++var14) { ModuleKeyBinding var15 = var12[var14]; if (var15 != this.entryKeybinding && var15.getKeyCode() == this.entryKeybinding.getKeyCode()) { var11 = true; break; } } } if (var10) { this.btnChangeKeyBinding.displayString = EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + this.btnChangeKeyBinding.displayString + EnumChatFormatting.WHITE + " <"; } else if (var11) { this.btnChangeKeyBinding.displayString = EnumChatFormatting.RED + this.btnChangeKeyBinding.displayString; } this.btnChangeKeyBinding.drawButton(GuiKeyBindingList.this.mc, buttonX, buttonY); }
Example 5
Source File: OptionKeyBind.java From NotEnoughItems with MIT License | 5 votes |
@Override public String getButtonText() { if (hasFocus) return EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; if (conflicted()) return EnumChatFormatting.RED + Keyboard.getKeyName(getValue()); return Keyboard.getKeyName(getValue()); }
Example 6
Source File: ClientEventHandler.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@SubscribeEvent public void onItemTooltip(ItemTooltipEvent event){ if(event.itemStack.getItem() instanceof IProgrammable) { IProgrammable programmable = (IProgrammable)event.itemStack.getItem(); if(programmable.canProgram(event.itemStack) && programmable.showProgramTooltip()) { boolean hasInvalidPrograms = false; List<String> addedEntries = new ArrayList<String>(); Map<String, Integer> widgetMap = getPuzzleSummary(TileEntityProgrammer.getProgWidgets(event.itemStack)); for(Map.Entry<String, Integer> entry : widgetMap.entrySet()) { IProgWidget widget = ItemProgrammingPuzzle.getWidgetForName(entry.getKey()); String prefix = ""; GuiScreen curScreen = Minecraft.getMinecraft().currentScreen; if(curScreen instanceof IGuiDrone) { if(!((IGuiDrone)curScreen).getDrone().isProgramApplicable(widget)) { prefix = EnumChatFormatting.RED + ""; hasInvalidPrograms = true; } } addedEntries.add(prefix + "-" + entry.getValue() + "x " + I18n.format("programmingPuzzle." + entry.getKey() + ".name")); } if(hasInvalidPrograms) { event.toolTip.add(EnumChatFormatting.RED + I18n.format("gui.tooltip.programmable.invalidPieces")); } Collections.sort(addedEntries); event.toolTip.addAll(addedEntries); } } }
Example 7
Source File: ClientEventHandler.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@SubscribeEvent public void tickEnd(TickEvent.RenderTickEvent event){ if(event.phase == TickEvent.Phase.END && FMLClientHandler.instance().getClient().inGameHasFocus && PneumaticCraft.proxy.getPlayer().worldObj != null && (ModuleRegulatorTube.inverted || !ModuleRegulatorTube.inLine)) { Minecraft mc = FMLClientHandler.instance().getClient(); ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); FontRenderer fontRenderer = FMLClientHandler.instance().getClient().fontRenderer; String warning = EnumChatFormatting.RED + I18n.format("gui.regulatorTube.hudMessage." + (ModuleRegulatorTube.inverted ? "inverted" : "notInLine")); fontRenderer.drawStringWithShadow(warning, sr.getScaledWidth() / 2 - fontRenderer.getStringWidth(warning) / 2, sr.getScaledHeight() / 2 + 30, 0xFFFFFFFF); } }
Example 8
Source File: IMediaGui.java From MediaMod with GNU General Public License v3.0 | 4 votes |
default String getSuffix(boolean option, String label) { return option ? (label + ": " + EnumChatFormatting.GREEN + I18n.format("menu.guimediamod.buttons.yes")) : (label + ": " + EnumChatFormatting.RED + I18n.format("menu.guimediamod.buttons.no")); }
Example 9
Source File: ScoreboardDisplay.java From Hyperium with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void draw(int starX, double startY, boolean config) { if (objective != null) { boolean guiF = false; Scoreboard scoreboard = objective.getScoreboard(); Collection<Score> collection = scoreboard.getSortedScores(objective); List<Score> list = collection.stream().filter(p_apply_1_ -> p_apply_1_.getPlayerName() != null && !p_apply_1_.getPlayerName().startsWith("#")).collect(Collectors.toList()); collection = list.size() > 15 ? Lists.newArrayList(Iterables.skip(list, collection.size() - 15)) : list; int i = Minecraft.getMinecraft().fontRendererObj.getStringWidth(objective.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, Minecraft.getMinecraft().fontRendererObj.getStringWidth(s)); } int i1 = collection.size() * Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; int l1 = starX; if (ElementRenderer.getCurrent().isRightSided()) l1 -= i; int j = 0; int k; for (Score score1 : collection) { ++j; ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName()); String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName()); String s2 = EnumChatFormatting.RED + "" + score1.getScorePoints(); k = ((int) startY) + (collection.size() - j + 1) * Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; if (ElementRenderer.getCurrent().isHighlighted()) { if (guiF) { Gui.drawRect(l1 - 2, k, l1 + i, k + Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT, 1342177280); } else { RenderUtils.drawRect(l1 - 2, k, l1 + i, k + Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT, 1342177280); } } Minecraft.getMinecraft().fontRendererObj.drawString(s1, l1, k, Color.WHITE.getRGB()); if (data.optBoolean("numbers")) { Minecraft.getMinecraft().fontRendererObj.drawString(s2, l1 + i - Minecraft.getMinecraft().fontRendererObj.getStringWidth(s2), k, Color.WHITE.getRGB()); } if (j == collection.size()) { String s3 = objective.getDisplayName(); if (ElementRenderer.getCurrent().isHighlighted()) { if (guiF) { Gui.drawRect(l1 - 2, k - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT - 1, l1 + i, k - 1, 1610612736); Gui.drawRect(l1 - 2, k - 1, l1 + i, k, 1342177280); } else { RenderUtils.drawRect(l1 - 2, k - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT - 1, l1 + i, k - 1, 1610612736); RenderUtils.drawRect(l1 - 2, k - 1, l1 + i, k, 1342177280); } } Minecraft.getMinecraft().fontRendererObj.drawString(s3, l1 + i / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(s3) / 2, k - Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT, Color.WHITE.getRGB()); } } width = i - (data.optBoolean("numbers") ? 0 : 10); height = i1 + 10; } }
Example 10
Source File: ScoreboardRenderer.java From Hyperium with GNU Lesser General Public License v3.0 | 4 votes |
public void render(ScoreObjective objective, ScaledResolution resolution) { RenderScoreboardEvent renderEvent = new RenderScoreboardEvent(xLocation, yLocation, objective, resolution); EventBus.INSTANCE.post(renderEvent); if (!renderEvent.isCancelled()) { Scoreboard scoreboard = objective.getScoreboard(); Collection<Score> collection = scoreboard.getSortedScores(objective); List<Score> list = collection.stream().filter(p_apply_1_ -> p_apply_1_.getPlayerName() != null && !p_apply_1_.getPlayerName().startsWith("#")).collect(Collectors.toList()); collection = list.size() > 15 ? Lists.newArrayList(Iterables.skip(list, collection.size() - 15)) : list; int i = getFontRenderer().getStringWidth(objective.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, getFontRenderer().getStringWidth(s)); } int i1 = collection.size() * getFontRenderer().FONT_HEIGHT; int j1 = (int) (resolution.getScaledHeight_double() * yLocation) + i1 / 3; int k1 = 3; int l1 = (int) (resolution.getScaledWidth_double() * xLocation) - 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.toString() + score1.getScorePoints(); int k = j1 - j * getFontRenderer().FONT_HEIGHT; int l = (int) (resolution.getScaledWidth_double() * xLocation) - k1 + 2; RenderUtils.drawRect(l1 - 2, k, l, k + getFontRenderer().FONT_HEIGHT, 1342177280); getFontRenderer().drawString(s1, l1, k, 553648127); getFontRenderer().drawString(s2, l - getFontRenderer().getStringWidth(s2), k, 553648127); if (j == collection.size()) { String s3 = objective.getDisplayName(); RenderUtils.drawRect(l1 - 2, k - getFontRenderer().FONT_HEIGHT - 1, l, k - 1, 1610612736); RenderUtils.drawRect(l1 - 2, k - 1, l, k, 1342177280); getFontRenderer().drawString(s3, l1 + i / 2 - getFontRenderer().getStringWidth(s3) / 2, k - getFontRenderer().FONT_HEIGHT, 553648127); } } } }
Example 11
Source File: GuiSidebar.java From Hyperium with GNU Lesser General Public License v3.0 | 4 votes |
public void drawSidebar(ScoreObjective sidebar, ScaledResolution res) { if (!enabled) { return; } FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; Scoreboard scoreboard = sidebar.getScoreboard(); List<Score> scores = new ArrayList<>(); sidebarWidth = fr.getStringWidth(sidebar.getDisplayName()); for (Score score : scoreboard.getSortedScores(sidebar)) { String name = score.getPlayerName(); if (scores.size() < 15 && name != null && !name.startsWith("#")) { Team team = scoreboard.getPlayersTeam(name); String s2 = redNumbers ? (": " + EnumChatFormatting.RED + score.getScorePoints()) : ""; String str = ScorePlayerTeam.formatPlayerName(team, name) + s2; sidebarWidth = Math.max(sidebarWidth, fr.getStringWidth(str)); scores.add(score); } } sidebarHeight = scores.size() * fr.FONT_HEIGHT; sidebarX = res.getScaledWidth() - sidebarWidth - 3 + offsetX; sidebarY = res.getScaledHeight() / 2 + sidebarHeight / 3 + offsetY; int scalePointX = sidebarX + sidebarWidth; int scalePointY = sidebarY - sidebarHeight / 2; float mscale = scale - 1.0f; GlStateManager.translate(-scalePointX * mscale, -scalePointY * mscale, 0.0f); GlStateManager.scale(scale, scale, 1.0F); int index = 0; for (Score score2 : scores) { ++index; ScorePlayerTeam team2 = scoreboard.getPlayersTeam(score2.getPlayerName()); String s3 = ScorePlayerTeam.formatPlayerName(team2, score2.getPlayerName()); String s4 = EnumChatFormatting.RED + "" + score2.getScorePoints(); if (!redNumbers) { s4 = ""; } int scoreX = sidebarX + sidebarWidth + 1; int scoreY = sidebarY - index * fr.FONT_HEIGHT; drawRect(sidebarX - 2, scoreY, scoreX, scoreY + fr.FONT_HEIGHT, getColor(false, true)); drawString(s3, sidebarX, scoreY, getColor(false, false)); drawString(s4, scoreX - fr.getStringWidth(s4), scoreY, getColor(false, false)); if (index == scores.size()) { String s5 = sidebar.getDisplayName(); drawRect(sidebarX - 2, scoreY - fr.FONT_HEIGHT - 1, scoreX, scoreY - 1, getColor(true, true)); drawRect(sidebarX - 2, scoreY - 1, scoreX, scoreY, getColor(false, true)); drawString(s5, sidebarX + (sidebarWidth - fr.getStringWidth(s5)) / 2, scoreY - fr.FONT_HEIGHT, chromaEnabled ? getColor(false, false) : 553648127); } } GlStateManager.scale(1.0F / scale, 1.0F / scale, 1.0F); GlStateManager.translate(scalePointX * mscale, scalePointY * mscale, 0.0f); }
Example 12
Source File: ComponentHealth.java From Artifacts with MIT License | 4 votes |
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, String trigger, boolean advTooltip) { String heart = StatCollector.translateToLocal("effect.Hearts"); if(heart.equals("{H}")) heart = "" + EnumChatFormatting.RED + ((char) 0x2665);//♥ par3List.add(StatCollector.translateToLocal("effect.Health Boost") + " " + StatCollector.translateToLocal("tool."+trigger) + " " + EnumChatFormatting.BLUE + "+2.5 " + heart); }