Search in sources :

Example 1 with ChatFormatting

use of com.mojang.realmsclient.gui.ChatFormatting in project BapeClient by BapeDeveloperTeam.

the class NameTags method onPreRender.

@SubscribeEvent
public void onPreRender(RenderPlayerEvent.Pre event) {
    if (Client.nullCheck())
        return;
    double v = 0.3;
    Scoreboard sb = event.entityPlayer.getWorldScoreboard();
    ScoreObjective sbObj = sb.getObjectiveInDisplaySlot(2);
    if (sbObj != null && !event.entityPlayer.getDisplayNameString().equals(mc.thePlayer.getDisplayNameString()) && event.entityPlayer.getDistanceSqToEntity((Entity) mc.thePlayer) < 100.0) {
        v *= 2.0;
    }
    if (!event.entityPlayer.getDisplayName().equals(mc.thePlayer.getDisplayName())) {
        ChatFormatting Format = ChatFormatting.WHITE;
        if (event.entityPlayer.getHealth() > 15) {
            Format = ChatFormatting.WHITE;
        } else if (event.entityPlayer.getHealth() > 8 && event.entityPlayer.getHealth() < 15) {
            Format = ChatFormatting.YELLOW;
        } else {
            Format = ChatFormatting.RED;
        }
        Nameplate np = new Nameplate(event.entityPlayer.getDisplayNameString(), event.x, event.y, event.z, event.entityLiving);
        np.renderNewPlate(new Color(150, 150, 150));
    }
}
Also used : Nameplate(mc.bape.util.utils.Nameplate) ScoreObjective(net.minecraft.scoreboard.ScoreObjective) Scoreboard(net.minecraft.scoreboard.Scoreboard) ChatFormatting(com.mojang.realmsclient.gui.ChatFormatting) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with ChatFormatting

use of com.mojang.realmsclient.gui.ChatFormatting in project postman by srgantmoomoo.

the class CommandManager method sendCommandDescriptions.

// TODO find a better color for syntax or something lol.
private void sendCommandDescriptions() {
    ChatFormatting GRAY = ChatFormatting.GRAY;
    ChatFormatting RED = ChatFormatting.RED;
    ChatFormatting ITALIC = ChatFormatting.ITALIC;
    for (Command c : Main.INSTANCE.commandManager.commands) {
        sendClientChatMessage(c.name + " - " + GRAY + c.description + RED + ITALIC + " [" + c.syntax + "]", false);
    }
}
Also used : ChatFormatting(com.mojang.realmsclient.gui.ChatFormatting)

Aggregations

ChatFormatting (com.mojang.realmsclient.gui.ChatFormatting)2 Nameplate (mc.bape.util.utils.Nameplate)1 ScoreObjective (net.minecraft.scoreboard.ScoreObjective)1 Scoreboard (net.minecraft.scoreboard.Scoreboard)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1