Java Code Examples for net.minecraft.util.EnumChatFormatting#GREEN

The following examples show how to use net.minecraft.util.EnumChatFormatting#GREEN . 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 vote down vote up
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 vote down vote up
@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: PacketTCNotificationText.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public IMessage onMessage(PacketTCNotificationText message, MessageContext ctx) {
    if(message.text == null) return null;
    String translated = StatCollector.translateToLocal(message.text);
    ResourceLocation image = null;
    int color = message.color;
    Aspect a = Aspect.getAspect(message.additionalInfo);
    if(a != null) {
        image = a.getImage();
        color = a.getColor();
    }
    if(message.text.equals("gadomancy.aura.research.unlock")) {
        if(a != null) {
            translated = EnumChatFormatting.GREEN + String.format(translated, a.getName());
        } else {
            translated = EnumChatFormatting.GREEN + String.format(translated, message.additionalInfo);
        }
    }
    color &= 0xFFFFFF;
    PlayerNotifications.addNotification(translated, image, color);
    return null;
}
 
Example 4
Source File: NEIModContainer.java    From NotEnoughItems with MIT License 6 votes vote down vote up
@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 5
Source File: GuiPlayerSettings.java    From MediaMod with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void actionPerformed(GuiButton button) throws IOException {
    super.actionPerformed(button);
    switch (button.id) {
        case 0:
            this.mc.displayGuiScreen(new GuiMediaModSettings());
            break;

        case 1:
            Settings.SHOW_ALBUM_ART = !Settings.SHOW_ALBUM_ART;
            button.displayString = getSuffix(Settings.SHOW_ALBUM_ART, I18n.format("menu.guiplayersettings.buttons.showAlbumArt.name"));
            break;

        case 2:
            Settings.AUTO_COLOR_SELECTION = !Settings.AUTO_COLOR_SELECTION;
            button.displayString = getSuffix(Settings.AUTO_COLOR_SELECTION, I18n.format("menu.guiplayersettings.buttons.colorSelection.name"));
            break;

        case 3:
            Settings.MODERN_PLAYER_STYLE = !Settings.MODERN_PLAYER_STYLE;
            button.displayString = getSuffix(Settings.MODERN_PLAYER_STYLE, I18n.format("menu.guiplayersettings.buttons.modernPlayer.name"));
            break;
        case 4:
            this.mc.displayGuiScreen(new GuiPlayerPositioning());
            break;
        case 5:
            int nextIndex = Settings.PROGRESS_STYLE.ordinal() + 1;
            if (nextIndex >= ProgressStyle.values().length) {
                nextIndex = 0;
            }
            Settings.PROGRESS_STYLE = ProgressStyle.values()[nextIndex];
            button.displayString = I18n.format("menu.guiplayersettings.buttons.progressStyle.name") + " " + EnumChatFormatting.GREEN + I18n.format("menu.guiplayersettings.buttons.progressStyle." + Settings.PROGRESS_STYLE.name().toLowerCase());
            break;
    }
}
 
Example 6
Source File: CommandListWorlds.java    From TickDynamic with MIT License 5 votes vote down vote up
public void writeFooter(StringBuilder builder) {
	if(maxPages == 0)
		builder.append(EnumChatFormatting.GRAY + "+" + StringUtils.repeat("=", borderWidth) + "+\n");
	else
	{
		String pagesStr = EnumChatFormatting.GREEN + "Page " + currentPage + "/" + maxPages;
		int pagesLength = getVisibleLength(pagesStr);
		int otherLength = borderWidth - pagesLength;
		builder.append(EnumChatFormatting.GRAY + "+" + StringUtils.repeat("=", otherLength/2));
		builder.append(pagesStr);
		builder.append(EnumChatFormatting.GRAY + StringUtils.repeat("=", otherLength/2) + "+\n");
	}
}
 
Example 7
Source File: CommandWorld.java    From TickDynamic with MIT License 5 votes vote down vote up
private void writeFooter(StringBuilder builder) {
	if(maxPages == 0)
		builder.append(EnumChatFormatting.GRAY + "+" + StringUtils.repeat("=", borderWidth) + "+\n");
	else
	{
		String pagesStr = EnumChatFormatting.GREEN + "Page " + currentPage + "/" + maxPages;
		int pagesLength = getVisibleLength(pagesStr);
		int otherLength = borderWidth - pagesLength;
		builder.append(EnumChatFormatting.GRAY + "+" + StringUtils.repeat("=", otherLength/2));
		builder.append(pagesStr);
		builder.append(EnumChatFormatting.GRAY + StringUtils.repeat("=", otherLength/2) + "+\n");
	}
}
 
Example 8
Source File: ComponentMusicPlayer.java    From Artifacts with MIT License 5 votes vote down vote up
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, String trigger, boolean advTooltip) {
	String play = StatCollector.translateToLocal("effect.Play");
	if(play.equals("{Play}"))
		play = "" + EnumChatFormatting.GREEN + ((char) 0x266A) + EnumChatFormatting.LIGHT_PURPLE + ((char) 0x266B) + EnumChatFormatting.GOLD + ((char) 0x266A);
	
	//Get the localized record description
	String recordDescription = "Unknown";
	ItemRecord record = ItemRecord.getRecord("records."+itemStack.getTagCompound().getString("record"));
	if(record != null) { //If the record was from a mod that is no longer loaded, the description will stay "Unknown"
		recordDescription = record.getRecordNameLocal();
	}
	
	list.add(StatCollector.translateToLocal("effect.Plays the record") + " " + recordDescription + " " + StatCollector.translateToLocal("tool." + trigger) + " " + (itemStack.getTagCompound().getBoolean("playing") ? play : ""));
}
 
Example 9
Source File: IMediaGui.java    From MediaMod with GNU General Public License v3.0 4 votes vote down vote up
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 10
Source File: BasicDockerCommands.java    From mobycraft with Apache License 2.0 4 votes vote down vote up
public void ps() {

		boolean showAll = false;

		if (!Utils.checkIfArgIsNull(args, 0)
				&& args[0].split("-")[1].toLowerCase().contains("a")) {
			showAll = true;
		}

		List<Container> containers;

		if (showAll) {
			containers = listCommands.getAll();
		} else {
			containers = listCommands.getStarted();
		}

		if (containers.size() == 0) {
			if (showAll) {
				sendFeedbackMessage("No containers currently existing.");
			} else {
				sendFeedbackMessage("No containers currently running.");
			}
			return;
		}

		String firstMessage = EnumChatFormatting.AQUA + "Name(s)"
				+ EnumChatFormatting.RESET + ", " + EnumChatFormatting.GOLD
				+ "Image" + EnumChatFormatting.RESET + ", "
				+ EnumChatFormatting.GREEN + "Container ID";

		if (showAll) {
			firstMessage = firstMessage + EnumChatFormatting.RESET + ", "
					+ EnumChatFormatting.LIGHT_PURPLE + "Status ";
		}

		sendBarMessage(EnumChatFormatting.BLUE);
		sendMessage(firstMessage);
		sendBarMessage(EnumChatFormatting.BLUE);

		for (Container container : containers) {
			String message = "";
			for (String name : container.getNames()) {
				if (container.getNames()[0].equals(name)) {
					message += EnumChatFormatting.AQUA
							+ name.substring(1, name.length());
				} else {
					message += ", " + name;
				}
			}

			String state = "running";

			if (listCommands.isStopped(container.getNames()[0])) {
				state = "stopped";
			}

			message += EnumChatFormatting.RESET + ", "
					+ EnumChatFormatting.GOLD + container.getImage()
					+ EnumChatFormatting.RESET + ", "
					+ EnumChatFormatting.GREEN
					+ container.getId().substring(0, 12);
			if (showAll) {
				message = message + EnumChatFormatting.RESET + ", "
						+ EnumChatFormatting.LIGHT_PURPLE + state;
			}
			sendMessage(message);
		}
	}