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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations