@Environment(value=CLIENT) public class ChatHud extends DrawableHelper
Modifier and Type | Field and Description |
---|---|
private MinecraftClient |
client |
private boolean |
hasUnreadNewMessages |
private long |
lastMessageAddedTime |
private static Logger |
LOGGER |
private List<String> |
messageHistory |
private Deque<Text> |
messageQueue |
private List<ChatHudLine<Text>> |
messages |
private int |
scrolledLines |
private List<ChatHudLine<OrderedText>> |
visibleMessages |
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
ChatHud(MinecraftClient client) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(Text message) |
private void |
addMessage(Text message,
int messageId) |
private void |
addMessage(Text message,
int messageId,
int timestamp,
boolean refresh) |
void |
addToMessageHistory(String message) |
void |
clear(boolean clearHistory) |
private long |
getChatDelayMillis() |
double |
getChatScale() |
int |
getHeight() |
static int |
getHeight(double heightOption) |
List<String> |
getMessageHistory() |
private static double |
getMessageOpacityMultiplier(int age) |
Style |
getText(double x,
double y) |
int |
getVisibleLineCount() |
int |
getWidth() |
static int |
getWidth(double widthOption) |
private boolean |
isChatFocused() |
private boolean |
isChatHidden() |
boolean |
mouseClicked(double mouseX,
double mouseY) |
private void |
processMessageQueue() |
void |
queueMessage(Text message) |
private void |
removeMessage(int messageId) |
void |
render(MatrixStack matrices,
int tickDelta) |
void |
reset() |
void |
resetScroll() |
void |
scroll(double amount) |
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
private static final Logger LOGGER
private final MinecraftClient client
private final List<ChatHudLine<Text>> messages
private final List<ChatHudLine<OrderedText>> visibleMessages
private int scrolledLines
private boolean hasUnreadNewMessages
private long lastMessageAddedTime
public ChatHud(MinecraftClient client)
public void render(MatrixStack matrices, int tickDelta)
private boolean isChatHidden()
private static double getMessageOpacityMultiplier(int age)
public void clear(boolean clearHistory)
public void addMessage(Text message)
private void addMessage(Text message, int messageId)
private void addMessage(Text message, int messageId, int timestamp, boolean refresh)
public void reset()
public void addToMessageHistory(String message)
public void resetScroll()
public void scroll(double amount)
public boolean mouseClicked(double mouseX, double mouseY)
private boolean isChatFocused()
private void removeMessage(int messageId)
public int getWidth()
public int getHeight()
public double getChatScale()
public static int getWidth(double widthOption)
public static int getHeight(double heightOption)
public int getVisibleLineCount()
private long getChatDelayMillis()
private void processMessageQueue()
public void queueMessage(Text message)