use of meteordevelopment.meteorclient.systems.friends.Friend 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 meteordevelopment.meteorclient.systems.friends.Friend in project meteor-client by MeteorDevelopment.
the class FriendsCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("add").then(argument("friend", FriendArgumentType.friend()).executes(context -> {
Friend friend = FriendArgumentType.getFriend(context, "friend");
if (Friends.get().add(friend))
info("Added (highlight)%s (default)to friends.", friend.name);
else
error("That person is already your friend.");
return SINGLE_SUCCESS;
})));
builder.then(literal("remove").then(argument("friend", FriendArgumentType.friend()).executes(context -> {
Friend friend = FriendArgumentType.getFriend(context, "friend");
if (Friends.get().remove(friend))
info("Removed (highlight)%s (default)from friends.", friend.name);
else
error("That person is not your friend.");
return SINGLE_SUCCESS;
})));
builder.then(literal("list").executes(context -> {
info("--- Friends ((highlight)%s(default)) ---", Friends.get().count());
Friends.get().forEach(friend -> ChatUtils.info("(highlight)" + friend.name));
return SINGLE_SUCCESS;
}));
}
Aggregations