use of net.minecraft.util.text.Style in project GregTech by GregTechCE.
the class ImplosionCompressorInfo method generateBlockTooltips.
@Override
protected void generateBlockTooltips() {
super.generateBlockTooltips();
ITextComponent tooltip = new TextComponentTranslation("gregtech.multiblock.preview.limit", 14).setStyle(new Style().setColor(TextFormatting.AQUA));
addBlockTooltip(MetaBlocks.METAL_CASING.getItemVariant(MetalCasingType.STEEL_SOLID), tooltip);
}
use of net.minecraft.util.text.Style in project ICBM-Classic by BuiltBrokenModding.
the class ItemRocketLauncher method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> list, ITooltipFlag flag) {
final String key = "item.icbmclassic:rocketLauncher.info";
String translation = LanguageUtility.getLocal(key);
if (translation.contains("%s")) {
String str = String.format(translation, String.valueOf(ConfigMain.ROCKET_LAUNCHER_TIER_FIRE_LIMIT));
splitAdd(str, list, false, false);
}
if (Minecraft.getMinecraft().player != null && Minecraft.getMinecraft().player.isCreative())
list.add(new TextComponentTranslation("item.icbmclassic:rocketLauncher.info.creative").setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)).getFormattedText());
}
use of net.minecraft.util.text.Style in project malmo by Microsoft.
the class AgentQuitFromTimeUpImplementation method drawCountDown.
@Override
protected void drawCountDown(int secondsRemaining) {
TextComponentString text = new TextComponentString("" + secondsRemaining + "...");
Style style = new Style();
style.setBold(true);
if (secondsRemaining <= 5)
style.setColor(TextFormatting.RED);
text.setStyle(style);
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(text, 1);
}
use of net.minecraft.util.text.Style in project MorePlanets by SteveKunG.
the class CommandOpenCelestialScreen method execute.
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
EntityPlayerMP player = PlayerUtil.getPlayerBaseServerFromPlayerUsername(sender.getName(), true);
if (args.length == 1 && args[0].equals("disable")) {
if (!WorldTickEventHandler.survivalPlanetData.disableMessage) {
GalacticraftCore.packetPipeline.sendToServer(new PacketSimpleMP(EnumSimplePacketMP.S_SAVE_DISABLE_MESSAGE, GCCoreUtil.getDimensionID(player.world)));
sender.sendMessage(new TextComponentString(ColorUtils.stringToRGB(IItemRarity.ALIEN).toColoredFont() + "[More Planets] ").appendSibling(new TextComponentTranslation("command.mpcelestial.1").setStyle(new Style().setColor(TextFormatting.YELLOW))));
}
} else {
if (!WorldTickEventHandler.survivalPlanetData.hasSurvivalPlanetData) {
GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMP(EnumSimplePacketMP.C_OPEN_SURVIVAL_PLANET_GUI, player.dimension), player);
} else {
sender.sendMessage(new TextComponentString(ColorUtils.stringToRGB(IItemRarity.ALIEN).toColoredFont() + "[More Planets] ").appendSibling(new TextComponentTranslation("command.mpcelestial.2").setStyle(new Style().setColor(TextFormatting.RED))));
}
}
}
use of net.minecraft.util.text.Style in project AgriCraft by AgriCraft.
the class AgriGenomeRenderer method renderTextOverlay.
public void renderTextOverlay(MatrixStack transforms, IAgriGenePair<?> genePair) {
// Fetch font renderer
FontRenderer fontRenderer = this.getFontRenderer();
// Fetch styles
Tuple<Style, Style> textFormats = this.getTextFormats(genePair.getGene());
// Fetch colors
int blackColor = STYLE_GENE.getColor() == null ? 0 : STYLE_GENE.getColor().getColor();
int domColor = textFormats.getA().getColor() == null ? 0 : textFormats.getA().getColor().getColor();
int recColor = textFormats.getB().getColor() == null ? 0 : textFormats.getB().getColor().getColor();
// Fetch text components
IReorderingProcessor geneText = genePair.getGene().getGeneDescription().mergeStyle(STYLE_GENE).func_241878_f();
IReorderingProcessor domText = genePair.getDominant().getTooltip().func_241878_f();
IReorderingProcessor recText = genePair.getRecessive().getTooltip().func_241878_f();
// Calculate positions
float y1 = 0;
float x1 = (-fontRenderer.func_243245_a(geneText) + 0.0F) / 2;
float y2 = y1 + 1.5F * fontRenderer.FONT_HEIGHT;
float x2 = (-fontRenderer.func_243245_a(TEXT_SEPARATOR) + 0.0F) / 2;
float delta = 1.0F;
float dx_d = delta + fontRenderer.func_243245_a(domText);
float dx_r = delta + fontRenderer.func_243245_a(TEXT_SEPARATOR);
// Render text
this.getFontRenderer().func_238422_b_(transforms, geneText, x1, y1, blackColor);
this.getFontRenderer().func_238422_b_(transforms, TEXT_SEPARATOR, x2, y2, blackColor);
this.getFontRenderer().func_238422_b_(transforms, domText, x2 - dx_d, y2, blackColor);
this.getFontRenderer().func_238422_b_(transforms, recText, x2 + dx_r, y2, blackColor);
}
Aggregations