package net.minecraft.client.gui.chat;

import java.util.UUID;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ChatType;
import net.minecraft.client.Minecraft;

public class StandardChatListener implements ChatListener {
    private final Minecraft minecraft;
    
    public StandardChatListener(final Minecraft dlx) {
        this.minecraft = dlx;
    }
    
    @Override
    public void handle(final ChatType mo, final Component mr, final UUID uUID) {
        if (this.minecraft.isBlocked(uUID)) {
            return;
        }
        if (mo != ChatType.CHAT) {
            this.minecraft.gui.getChat().addMessage(mr);
        }
        else {
            this.minecraft.gui.getChat().enqueueMessage(mr);
        }
    }
}
