use of cc.hyperium.mixins.client.gui.IMixinGuiNewChat in project Hyperium by HyperiumClient.
the class HyperiumGuiNewChat method setChatLine.
public void setChatLine(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, int scrollPos, boolean isScrolled, List<ChatLine> chatLineList, List<ChatLine> chatLines, Minecraft mc) {
if (chatLineId != 0) {
parent.deleteChatLine(chatLineId);
}
int i = MathHelper.floor_float((float) parent.getChatWidth() / parent.getChatScale());
List<IChatComponent> list = GuiUtilRenderComponents.splitText(chatComponent, i, mc.fontRendererObj, false, false);
boolean flag = parent.getChatOpen();
list.forEach(ichatcomponent -> {
if (flag && scrollPos > 0) {
((IMixinGuiNewChat) parent).setIsScrolled(isScrolled);
parent.scroll(1);
}
chatLineList.add(0, new ChatLine(updateCounter, ichatcomponent, chatLineId));
});
while (chatLineList.size() > 500) {
chatLineList.remove(chatLineList.size() - 1);
}
if (!displayOnly) {
chatLines.add(0, new ChatLine(updateCounter, chatComponent, chatLineId));
while (chatLines.size() > 500) {
chatLines.remove(chatLines.size() - 1);
}
}
}
Aggregations