Search in sources :

Example 1 with TextColor

use of net.minecraft.text.TextColor in project meteor-client by MeteorDevelopment.

the class MeteorToast method setTitle.

public void setTitle(@NotNull String title) {
    this.title = new LiteralText(title).setStyle(Style.EMPTY.withColor(new TextColor(TITLE_COLOR)));
    justUpdated = true;
}
Also used : TextColor(net.minecraft.text.TextColor) LiteralText(net.minecraft.text.LiteralText)

Example 2 with TextColor

use of net.minecraft.text.TextColor in project meteor-client by MeteorDevelopment.

the class BetterTab method getPlayerName.

public Text getPlayerName(PlayerListEntry playerListEntry) {
    Text name;
    Color color = null;
    name = playerListEntry.getDisplayName();
    if (name == null)
        name = new LiteralText(playerListEntry.getProfile().getName());
    if (playerListEntry.getProfile().getId().toString().equals(mc.player.getGameProfile().getId().toString()) && self.get()) {
        color = selfColor.get();
    } else if (friends.get() && Friends.get().get(playerListEntry.getProfile().getName()) != null) {
        Friend friend = Friends.get().get(playerListEntry.getProfile().getName());
        if (friend != null)
            color = Friends.get().color;
    }
    if (color != null) {
        String nameString = name.getString();
        for (Formatting format : Formatting.values()) {
            if (format.isColor())
                nameString = nameString.replace(format.toString(), "");
        }
        name = new LiteralText(nameString).setStyle(name.getStyle().withColor(new TextColor(color.getPacked())));
    }
    return name;
}
Also used : Friend(meteordevelopment.meteorclient.systems.friends.Friend) Color(meteordevelopment.meteorclient.utils.render.color.Color) SettingColor(meteordevelopment.meteorclient.utils.render.color.SettingColor) TextColor(net.minecraft.text.TextColor) Formatting(net.minecraft.util.Formatting) LiteralText(net.minecraft.text.LiteralText) Text(net.minecraft.text.Text) TextColor(net.minecraft.text.TextColor) LiteralText(net.minecraft.text.LiteralText)

Example 3 with TextColor

use of net.minecraft.text.TextColor in project Client by MatHax.

the class BetterTab method getPlayerName.

public Text getPlayerName(PlayerListEntry playerListEntry) {
    Text name;
    Color color = null;
    name = playerListEntry.getDisplayName();
    if (name == null) {
        /*if (mc.getSession().getUsername().equals("Matejko06"))
                name = new LiteralText("  " + playerListEntry.getProfile().getName());
            else*/
        name = new LiteralText(playerListEntry.getProfile().getName());
    }
    if (playerListEntry.getProfile().getId().toString().equals(mc.player.getGameProfile().getId().toString()) && self.get()) {
        color = selfColor.get();
    } else if (friends.get() && Friends.get().get(playerListEntry.getProfile().getName()) != null) {
        Friend friend = Friends.get().get(playerListEntry.getProfile().getName());
        if (friend != null)
            color = Friends.get().color;
    } else if (enemies.get() && Enemies.get().get(playerListEntry.getProfile().getName()) != null) {
        Enemy enemy = Enemies.get().get(playerListEntry.getProfile().getName());
        if (enemy != null)
            color = Enemies.get().color;
    }
    if (color != null) {
        String nameString = name.getString();
        for (Formatting format : Formatting.values()) {
            if (format.isColor())
                nameString = nameString.replace(format.toString(), "");
        }
        name = new LiteralText(nameString).setStyle(name.getStyle().withColor(new TextColor(color.getPacked())));
    }
    return name;
}
Also used : Friend(mathax.client.systems.friends.Friend) SettingColor(mathax.client.utils.render.color.SettingColor) TextColor(net.minecraft.text.TextColor) Color(mathax.client.utils.render.color.Color) Enemy(mathax.client.systems.enemies.Enemy) Formatting(net.minecraft.util.Formatting) LiteralText(net.minecraft.text.LiteralText) Text(net.minecraft.text.Text) TextColor(net.minecraft.text.TextColor) LiteralText(net.minecraft.text.LiteralText)

Example 4 with TextColor

use of net.minecraft.text.TextColor in project Client by MatHax.

the class ToastSystem method setTitle.

public void setTitle(@NotNull String title) {
    this.title = new LiteralText(title).setStyle(Style.EMPTY.withColor(new TextColor(titleColor)));
    justUpdated = true;
}
Also used : TextColor(net.minecraft.text.TextColor) LiteralText(net.minecraft.text.LiteralText)

Example 5 with TextColor

use of net.minecraft.text.TextColor in project meteor-client by MeteorDevelopment.

the class MeteorToast method setText.

public void setText(@Nullable String text) {
    this.text = text != null ? new LiteralText(text).setStyle(Style.EMPTY.withColor(new TextColor(TEXT_COLOR))) : null;
    justUpdated = true;
}
Also used : TextColor(net.minecraft.text.TextColor) LiteralText(net.minecraft.text.LiteralText)

Aggregations

TextColor (net.minecraft.text.TextColor)10 LiteralText (net.minecraft.text.LiteralText)6 Text (net.minecraft.text.Text)4 Color (mathax.client.utils.render.color.Color)2 Color (meteordevelopment.meteorclient.utils.render.color.Color)2 Style (net.minecraft.text.Style)2 Formatting (net.minecraft.util.Formatting)2 StringRange (com.mojang.brigadier.context.StringRange)1 ChatFormatterRegistry (io.github.darkkronicle.advancedchatbox.registry.ChatFormatterRegistry)1 FluidText (io.github.darkkronicle.advancedchatcore.util.FluidText)1 RawText (io.github.darkkronicle.advancedchatcore.util.RawText)1 StringMatch (io.github.darkkronicle.advancedchatcore.util.StringMatch)1 HashMap (java.util.HashMap)1 Enemy (mathax.client.systems.enemies.Enemy)1 Friend (mathax.client.systems.friends.Friend)1 SettingColor (mathax.client.utils.render.color.SettingColor)1 Friend (meteordevelopment.meteorclient.systems.friends.Friend)1 SettingColor (meteordevelopment.meteorclient.utils.render.color.SettingColor)1 NbtCompound (net.minecraft.nbt.NbtCompound)1