Java Code Examples for net.minecraft.util.EnumChatFormatting

The following examples show how to use net.minecraft.util.EnumChatFormatting. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: NotEnoughItems   Source File: NEIModContainer.java    License: 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 2
public static void addTipToMachine(List<String> currenttip, IWailaDataAccessor accessor){
    NBTTagCompound tag = accessor.getNBTData();
    //This is used so that we can split values later easier and have them all in the same layout.
    Map<String, String> values = new HashMap<String, String>();

    if(tag.hasKey("redstoneMode")) {
        int mode = tag.getInteger("redstoneMode");
        GuiPneumaticContainerBase gui = (GuiPneumaticContainerBase)PneumaticCraft.proxy.getClientGuiElement(((BlockPneumaticCraft)accessor.getBlock()).getGuiID().ordinal(), accessor.getPlayer(), accessor.getWorld(), accessor.getPosition().blockX, accessor.getPosition().blockY, accessor.getPosition().blockZ);
        if(gui != null) {
            values.put(gui.getRedstoneString(), gui.getRedstoneButtonText(mode));
        }
    }

    //Get all the values from the map and put them in the list.
    for(Map.Entry<String, String> entry : values.entrySet()) {
        currenttip.add(EnumChatFormatting.RED + I18n.format(entry.getKey()) + ": " + /*SpecialChars.ALIGNRIGHT +*/I18n.format(entry.getValue()));
    }
}
 
Example 3
Source Project: Hyperium   Source File: DisplayTable.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void draw(int x, int y) {
    boolean first = true;
    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, 0);

    for (String[] row : rows) {
        FontRenderer fontRendererObj = Minecraft.getMinecraft().fontRendererObj;
        GlStateManager.pushMatrix();

        for (int i = 0; i < row.length; i++) {
            String tmp = row[i];
            fontRendererObj.drawString((first ? EnumChatFormatting.BOLD : "") + tmp, 0, 0, Color.WHITE.getRGB());
            GlStateManager.translate(rowSpacing[i], 0, 0);
        }

        GlStateManager.popMatrix();
        GlStateManager.translate(0, 11, 0);
        first = false;
    }

    GlStateManager.popMatrix();
}
 
Example 4
Source Project: PneumaticCraft   Source File: WidgetTank.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public void addTooltip(int mouseX, int mouseY, List<String> curTip, boolean shift){
    Fluid fluid = null;
    int amt = 0;
    int capacity = 0;

    if(tank.getFluid() != null) {
        fluid = tank.getFluid().getFluid();
        amt = tank.getFluidAmount();
    }
    capacity = tank.getCapacity();

    if(fluid == null || amt == 0 || capacity == 0) {
        curTip.add(amt + "/" + capacity + " mb");
        curTip.add(EnumChatFormatting.GRAY + I18n.format("gui.liquid.empty"));
    } else {
        curTip.add(amt + "/" + capacity + " mb");
        curTip.add(EnumChatFormatting.GRAY + fluid.getLocalizedName(new FluidStack(fluid, amt)));
    }
}
 
Example 5
@Override
public void addInfo(List<String> curInfo){
    super.addInfo(curInfo);
    String status;
    if(ticksSinceAction >= 0) {
        status = "waila.logisticsModule.transporting";
    } else if(ticksSinceNotEnoughAir >= 0) {
        status = "waila.logisticsModule.notEnoughAir";
    } else if(hasPower()) {
        status = "waila.logisticsModule.powered";
    } else {
        status = "waila.logisticsModule.noPower";
    }
    curInfo.add(StatCollector.translateToLocal("hud.msg.state") + ": " + StatCollector.translateToLocal(status));
    curInfo.add(StatCollector.translateToLocal("waila.logisticsModule.channel") + " " + EnumChatFormatting.YELLOW + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.field_150923_a[colorChannel]));
}
 
Example 6
Source Project: ehacks-pro   Source File: CommandManager.java    License: GNU General Public License v3.0 6 votes vote down vote up
public void processString(String message) {
    message = message.trim();

    if (message.startsWith("/")) {
        message = message.substring(1);
    }

    String[] temp = message.split(" ");
    String[] args = new String[temp.length - 1];
    String commandName = temp[0];
    System.arraycopy(temp, 1, args, 0, args.length);
    try {
        processCommand(getCommand(commandName), args);
    } catch (Exception e) {
        EHacksGui.clickGui.consoleGui.printChatMessage(format(EnumChatFormatting.RED, "commands.generic.exception"));
    }
}
 
Example 7
Source Project: AdvancedMod   Source File: WailaCamoHandler.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config){
    NBTTagCompound tag = accessor.getNBTData();
    String target = tag.getString("target");
    if(!target.equals("")) {
        currenttip.add(I18n.format("advancedMod.waila.camoMine.target") + " " + EnumChatFormatting.GREEN + target);
    }
    int timer = tag.getInteger("timer");
    if(timer == 0) {
        currenttip.add(I18n.format("advancedMod.waila.camoMine.primed"));
    } else if(timer == -1) {
        currenttip.add(I18n.format("advancedMod.waila.camoMine.notPrimed"));
    } else {
        currenttip.add(I18n.format("advancedMod.waila.camoMine.primingIn") + " " + timer);
    }
    return currenttip;
}
 
Example 8
Source Project: NotEnoughItems   Source File: NEIServerUtils.java    License: MIT License 6 votes vote down vote up
public static void givePlayerItem(EntityPlayerMP player, ItemStack stack, boolean infinite, boolean doGive) {
    if (stack.getItem() == null) {
        player.addChatComponentMessage(setColour(new ChatComponentTranslation("nei.chat.give.noitem"), EnumChatFormatting.WHITE));
        return;
    }

    int given = stack.stackSize;
    if(doGive) {
        if (infinite)
            player.inventory.addItemStackToInventory(stack);
        else
            given -= InventoryUtils.insertItem(player.inventory, stack, false);
    }

    sendNotice(player, new ChatComponentTranslation("commands.give.success", stack.getChatComponent(), infinite ? "\u221E" : Integer.toString(given), player.getCommandSenderName()), "notify-item");
    player.openContainer.detectAndSendChanges();
}
 
Example 9
Source Project: GTNEIOrePlugin   Source File: PluginGT5IEVeinStat.java    License: MIT License 6 votes vote down vote up
@Override
public void drawExtras(int recipe) {
    CachedIEVeinStatRecipe crecipe = (CachedIEVeinStatRecipe) this.arecipes.get(recipe);
    OreLayerWrapper oreLayer = GT5OreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName);
    int stringLength1 = GuiDraw.getStringWidth(I18n.format("gtnop.gui.nei.weightedChance") + ": ");
    int stringLength2 = GuiDraw.getStringWidth("40%");
    int beginXCoord = (stringLength1+stringLength2)/2;
    GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer.veinName), 2, 18, 0x404040, false);
    GuiDraw.drawString(I18n.format("gtnop.gui.nei.ieVeinComponent") + ": ", 2, 31, 0x404040, false);
    GuiDraw.drawStringR("40.00%", beginXCoord+5, 44, 0x404040, false);
    GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.primaryMeta)), 2+stringLength1, 44, 0x404040, false);
    GuiDraw.drawStringR("40.00%", beginXCoord+5, 57, 0x404040, false);
    GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.secondaryMeta)), 2+stringLength1, 57, 0x404040, false);
    GuiDraw.drawStringR("15.00%", beginXCoord+5, 70, 0x404040, false);
    GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.betweenMeta)), 2+stringLength1, 70, 0x404040, false);
    GuiDraw.drawStringR("5.00%", beginXCoord+5, 83, 0x404040, false);
    GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.sporadicMeta)), 2+stringLength1, 83, 0x404040, false);
    GuiDraw.drawString(I18n.format("gtnop.gui.nei.weightedChance") + ": " + oreLayer.weightedIEChance, 2, 96, 0x404040, false);
    GuiDraw.drawString(I18n.format("gtnop.gui.nei.fromMod") + ": " + "Immersive Engineering", 2, 109, 0x404040, false);
    GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false);
}
 
Example 10
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{
	if(!playerIn.isSneaking())
	{
		if(stack.getTagCompound() == null)
		{
			stack.setTagCompound(new NBTTagCompound());
		}
		NBTTagCompound nbt = new NBTTagCompound();
		nbt.setInteger("dim", playerIn.dimension);
		nbt.setInteger("posX", pos.getX());
		nbt.setInteger("posY", pos.getY());
		nbt.setInteger("posZ", pos.getZ());
		stack.getTagCompound().setTag("coords", nbt);
		stack.setStackDisplayName(EnumChatFormatting.DARK_PURPLE + "Coordinate Cache");
	}
	return false;
}
 
Example 11
Source Project: GardenCollection   Source File: ItemUsedSoilKit.java    License: MIT License 6 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void addInformation (ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
    float temperature = (itemStack.getItemDamage() & 127) / 127f;
    float humidity = ((itemStack.getItemDamage() >> 7) & 127) / 127f;

    EnumChatFormatting tempColor = EnumChatFormatting.BLUE;
    if (temperature >= .2)
        tempColor = EnumChatFormatting.DARK_GREEN;
    if (temperature >= 1)
        tempColor = EnumChatFormatting.DARK_RED;

    EnumChatFormatting humidColor = EnumChatFormatting.DARK_RED;
    if (humidity >= .3)
        humidColor = EnumChatFormatting.GOLD;
    if (humidity >= .6)
        humidColor = EnumChatFormatting.DARK_GREEN;

    String temperatureStr = StatCollector.translateToLocal("gardencore.soilkit.temperature") + ": " + tempColor + String.format("%.2f", temperature) ;
    String humidityStr = StatCollector.translateToLocal("gardencore.soilkit.rainfall") + ": " + humidColor + String.format("%.2f", humidity);

    list.add(temperatureStr);
    list.add(humidityStr);
}
 
Example 12
@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 13
@SubscribeEvent
public void onBreak(BlockEvent.BreakEvent event) {
    if (!event.world.isRemote) {
        if (event.block == RegisteredBlocks.blockNodeManipulator) {
            TileEntity te = event.world.getTileEntity(event.x, event.y, event.z);
            if (te != null && te instanceof TileNodeManipulator) {
                if (((TileNodeManipulator) te).isInMultiblock())
                    ((TileNodeManipulator) te).breakMultiblock();
            }
        }
        if (event.block == RegisteredBlocks.blockStoneMachine && event.blockMetadata == 5) {
            TileAIShutdown.removeTrackedEntities(event.world, event.x, event.y, event.z);
        }
        if (event.world.provider.dimensionId == ModConfig.dimOuterId) {
            if(event.block == ConfigBlocks.blockEldritchNothing) {
                if(event.getPlayer().capabilities.isCreativeMode && MiscUtils.isANotApprovedOrMisunderstoodPersonFromMoreDoor(event.getPlayer())) return;
                event.setCanceled(true);
                event.getPlayer().addChatMessage(new ChatComponentText(EnumChatFormatting.ITALIC + "" + EnumChatFormatting.GRAY + StatCollector.translateToLocal("gadomancy.eldritch.nobreakPortalNothing")));
            }
        }
    }
}
 
Example 14
@SubscribeEvent(priority = EventPriority.NORMAL)
public void on(ItemTooltipEvent e) {
    if (e.toolTip.size() > 0 && e.itemStack.hasTagCompound()) {
        if (e.itemStack.stackTagCompound.getBoolean("isStickyJar")) {
            e.toolTip.add(1, "\u00a7a" + StatCollector.translateToLocal("gadomancy.lore.stickyjar"));
        }
    }

    if(e.toolTip.size() > 0 && NBTHelper.hasPersistentData(e.itemStack)) {
        NBTTagCompound compound = NBTHelper.getPersistentData(e.itemStack);
        if(compound.hasKey("disguise")) {
            NBTBase base = compound.getTag("disguise");
            String lore;
            if(base instanceof NBTTagCompound) {
                ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) base);
                lore = String.format(StatCollector.translateToLocal("gadomancy.lore.disguise.item"), EnumChatFormatting.getTextWithoutFormattingCodes(stack.getDisplayName()));
            } else {
                lore = StatCollector.translateToLocal("gadomancy.lore.disguise.none");
            }
            e.toolTip.add("\u00a7a" + lore);
        }
    }
}
 
Example 15
private List<String> getStatusText(){
    List<String> text = new ArrayList<String>();
    text.add(EnumChatFormatting.GRAY + "Protection");
    if(te.getRebootTime() > 0) {
        text.add(EnumChatFormatting.DARK_RED + "No protection because of rebooting!");
    } else if(te.isHacked()) {
        text.add(EnumChatFormatting.DARK_RED + "Hacked by:");
        for(GameProfile hacker : te.hackedUsers) {
            text.add(EnumChatFormatting.DARK_RED + "-" + hacker.getName());
        }
    } else {
        text.add(EnumChatFormatting.BLACK + "System secure");
    }
    text.add(EnumChatFormatting.GRAY + "Security Level");
    text.add(EnumChatFormatting.BLACK + "Level " + te.getSecurityLevel());
    text.add(EnumChatFormatting.GRAY + "Intruder Detection Chance");
    text.add(EnumChatFormatting.BLACK.toString() + te.getDetectionChance() + "%%");
    text.add(EnumChatFormatting.GRAY + "Security Range");
    text.add(EnumChatFormatting.BLACK.toString() + te.getSecurityRange() + "m (square)");
    return text;
}
 
Example 16
Source Project: Chisel-2   Source File: PlayerSpecials.java    License: GNU General Public License v2.0 5 votes vote down vote up
private boolean nameIsGood(Entity entity){
    if(EnumChatFormatting.getTextWithoutFormattingCodes(entity.getCommandSenderName()).equals("Cricket")
|| EnumChatFormatting.getTextWithoutFormattingCodes(entity.getCommandSenderName()).equals("Drullkus")
|| EnumChatFormatting.getTextWithoutFormattingCodes(entity.getCommandSenderName()).equals("minecreatr"))
        return true;
    return false;
}
 
Example 17
private List<String> getAccessText(){
    List<String> textList = new ArrayList<String>();
    textList.add("                                      ");
    textList.add("");
    for(GameProfile user : te.sharedUsers) {
        textList.add(EnumChatFormatting.BLACK + "-" + user.getName());
    }
    return textList;
}
 
Example 18
Source Project: bartworks   Source File: TT_MetaTileEntity_LowPowerLaserHatch.java    License: MIT License 5 votes vote down vote up
@Override
public String[] getDescription() {
    return new String[]{
            this.mDescription,
            StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + EnumChatFormatting.YELLOW + this.getTotalPower() + EnumChatFormatting.RESET + " EU/t",
            StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"
    };
}
 
Example 19
Source Project: NEI-Integration   Source File: RecipeHandlerHarvester.java    License: MIT License 5 votes vote down vote up
@Override
public List<String> provideTooltip(GuiRecipe guiRecipe, List<String> currenttip, CachedBaseRecipe crecipe, Point relMouse) {
    super.provideTooltip(guiRecipe, currenttip, crecipe, relMouse);
    if (new Rectangle(129, 2, 8, 60).contains(relMouse)) {
        currenttip.add(energyPerOperation + " RF");
    } else if (new Rectangle(48, 24, 16, 16).contains(relMouse)) {
        currenttip.add(Utils.translate("handler.harvester.harvestables"));
        currenttip.add(EnumChatFormatting.GRAY + Utils.translate("handler.harvester.harvestables.1"));
    }
    return currenttip;
}
 
Example 20
@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 21
@Override
public void addItemDescription(List<String> curInfo){
    curInfo.add(EnumChatFormatting.BLUE + "Formula: Redstone = 2.0 x pressure(bar)");
    curInfo.add("This module emits a redstone signal of which");
    curInfo.add("the strength is dependant on how much pressure");
    curInfo.add("the tube is at.");
}
 
Example 22
Source Project: TickDynamic   Source File: CommandHandler.java    License: MIT License 5 votes vote down vote up
public static String getTPSFormatted(TickDynamicMod mod) {
	String tpsOut;
	String color;
	
	if(mod.averageTPS >= 19)
		color = EnumChatFormatting.GREEN.toString();
	else if(mod.averageTPS > 10)
		color = EnumChatFormatting.YELLOW.toString();
	else
		color = EnumChatFormatting.RED.toString();
	
	DecimalFormat tpsFormat = new DecimalFormat("#.00");
	tpsOut = color + tpsFormat.format(mod.averageTPS) + EnumChatFormatting.RESET;
	return tpsOut;
}
 
Example 23
@Override
protected void addProblems(List<String> text){
    super.addProblems(text);
    if(te.getRebootTime() > 0) {
        text.add(EnumChatFormatting.GRAY + "The Security Station doesn't provide security!");
        text.add(EnumChatFormatting.BLACK + "The station is rebooting (" + PneumaticCraftUtils.convertTicksToMinutesAndSeconds(te.getRebootTime(), false) + ").");
    } else if(te.isHacked()) {
        text.add(EnumChatFormatting.GRAY + "This Station has been hacked!");
        text.add(EnumChatFormatting.BLACK + "Reboot the station.");
    }
    if(!te.hasValidNetwork()) {
        text.add(EnumChatFormatting.GRAY + "Invalid network configuration!");
        switch(te.checkForNetworkValidity()){
            case NO_SUBROUTINE:
                text.add(EnumChatFormatting.BLACK + "Add a Diagnostic Subroutine.");
                break;
            case NO_IO_PORT:
                text.add(EnumChatFormatting.BLACK + "Add a Network IO Port.");
                break;
            case NO_REGISTRY:
                text.add(EnumChatFormatting.BLACK + "Add a Network Registry.");
                break;
            case TOO_MANY_SUBROUTINES:
                text.add(EnumChatFormatting.BLACK + "There can only be one Diagnostic Subroutine.");
                break;
            case TOO_MANY_IO_PORTS:
                text.add(EnumChatFormatting.BLACK + "There can only be one Network IO Port.");
                break;
            case TOO_MANY_REGISTRIES:
                text.add(EnumChatFormatting.BLACK + "There can only be one Network Registry.");
                break;
            case NO_CONNECTION_SUB_AND_IO_PORT:
                text.add(EnumChatFormatting.BLACK + "The Diagnostic Subroutine and the Network IO Port need to be connected in the network.");
                break;
            case NO_CONNECTION_IO_PORT_AND_REGISTRY:
                text.add(EnumChatFormatting.BLACK + "The Network Registry and the Network IO Port need to be connected in the network.");
                break;
        }
    }
}
 
Example 24
Source Project: archimedes-ships   Source File: CommandASHelp.java    License: MIT License 5 votes vote down vote up
@Override
public void processCommand(ICommandSender icommandsender, String[] astring)
{
	icommandsender.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA.toString() + "Archimedes' Ships mod commands:"));
	for (CommandBase cb : asCommands)
	{
		icommandsender.addChatMessage(new ChatComponentText(cb.getCommandUsage(icommandsender)));
	}
}
 
Example 25
@Override
protected void addPressureStatInfo(List<String> pressureStatText){
    super.addPressureStatInfo(pressureStatText);

    pressureStatText.add(EnumChatFormatting.GRAY + "Energy production:");
    pressureStatText.add(EnumChatFormatting.BLACK + PneumaticCraftUtils.roundNumberTo(PneumaticValues.PRODUCTION_ELECTROSTATIC_COMPRESSOR / connectedCompressors, 1) + " mL/lightning strike");
    pressureStatText.add(EnumChatFormatting.GRAY + "Maximum air redirection:");
    pressureStatText.add(EnumChatFormatting.BLACK + PneumaticCraftUtils.roundNumberTo(PneumaticValues.MAX_REDIRECTION_PER_IRON_BAR * te.ironBarsBeneath, 1) + " mL/lightning strike");
}
 
Example 26
Source Project: NotEnoughItems   Source File: ItemInfo.java    License: MIT License 5 votes vote down vote up
public static String getSearchName(ItemStack stack) {
    String s = itemSearchNames.get(stack);
    if(s == null) {
        s = EnumChatFormatting.getTextWithoutFormattingCodes(GuiContainerManager.concatenatedDisplayName(stack, true).toLowerCase());
        itemSearchNames.put(stack, s);
    }
    return s;
}
 
Example 27
/**
 * You can add problem messages here if an assembly program has a problem with a certain step.
 * @param problemList
 */
@SuppressWarnings("incomplete-switch")
public void addProgramProblem(List<String> problemList){
    switch(curProblem){
        case NO_INPUT:
            problemList.addAll(PneumaticCraftUtils.convertStringIntoList(EnumChatFormatting.GRAY + "The input IO Unit can't find an inventory with a Block of Compressed Iron.", GuiConstants.maxCharPerLineLeft));
            problemList.addAll(PneumaticCraftUtils.convertStringIntoList(EnumChatFormatting.BLACK + "Place an inventory with a Block of Compressed Iron surrounding the IO Unit.", GuiConstants.maxCharPerLineLeft));
            break;
        case NO_OUTPUT:
            problemList.addAll(PneumaticCraftUtils.convertStringIntoList(EnumChatFormatting.GRAY + "The output IO Unit can't find an inventory to place the output in.", GuiConstants.maxCharPerLineLeft));
            problemList.addAll(PneumaticCraftUtils.convertStringIntoList(EnumChatFormatting.BLACK + "Place an inventory / make space in a connected inventory.", GuiConstants.maxCharPerLineLeft));
            break;
    }
}
 
Example 28
@Override
public void addInfo(Entity entity, List<String> curInfo){
    curInfo.add("Owner: " + ((EntityDrone)entity).playerName);
    curInfo.add("Routine: " + ((EntityDrone)entity).getLabel());
    if(DroneDebugUpgradeHandler.enabledForPlayer(PneumaticCraft.proxy.getPlayer()) && NBTUtil.getInteger(PneumaticCraft.proxy.getPlayer().getCurrentArmor(3), NBTKeys.PNEUMATIC_HELMET_DEBUGGING_DRONE) != entity.getEntityId()) {
        curInfo.add(EnumChatFormatting.RED + "Press '" + Keyboard.getKeyName(KeyHandler.getInstance().keybindDebuggingDrone.getKeyCode()) + "' to debug");
    }
}
 
Example 29
Source Project: mobycraft   Source File: GenericItem.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer playerIn,
		List<String> tooltip, boolean advanced) {
	if (!this.getUnlocalizedName().equals("container_wand")) {
		return;
	}

	tooltip.add(EnumChatFormatting.DARK_RED
			+ "Right click on a container's \"Name:\" sign to remove the container.");
}
 
Example 30
Source Project: mobycraft   Source File: ConfigurationCommands.java    License: Apache License 2.0 5 votes vote down vote up
public void getHostAndPath() {
//		if (configProperties.getDockerHostProperty() == null || configProperties.getCertPathProperty() == null) {
//			refreshHostAndPath();
//		}

		sendMessage(EnumChatFormatting.BLUE + "" + EnumChatFormatting.BOLD
				+ "Docker host: " + EnumChatFormatting.RESET + getConfigProperties().getDockerHostProperty().getString());
		sendMessage(EnumChatFormatting.GOLD + "" + EnumChatFormatting.BOLD
				+ "Docker cert path: " + EnumChatFormatting.RESET + getConfigProperties().getCertPathProperty().getString());
	}