MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / setChatLine

Method setChatLine

Minecraft-Utils/1.12.2/src/Gui2ndChat.java:164–197  ·  view source on GitHub ↗
(hh chatComponent, int id, int currentUpdateCounter, boolean refresh)

Source from the content-addressed store, hash-verified

162 }
163
164 private void setChatLine(hh chatComponent, int id, int currentUpdateCounter, boolean refresh) {
165 if (!refresh && MinecraftFactory.getClassProxyCallback().isShowTimeBeforeChatMessage()) {
166 chatComponent = (hh) MinecraftFactory.getClassProxyCallback().getChatComponentWithTime(chatComponent);
167 }
168 if (id != 0) {
169 this.deleteChatLine(id);
170 }
171
172 int lineWidth = rk.d((float) this.getChatWidth() / this.getChatScale());
173 List<hh> lines = bjc.a(chatComponent, lineWidth, ((Variables) MinecraftFactory.getVars()).getFontrenderer(), false, false);
174 boolean var6 = this.isChatOpened();
175
176 hh lineString;
177 for (Iterator<hh> iterator = lines.iterator(); iterator.hasNext(); this.singleChatLines.add(0, new GuiChatLine(currentUpdateCounter, lineString, id))) {
178 lineString = iterator.next();
179 if (var6 && this.scrollPos > 0) {
180 this.isScrolled = true;
181 this.scroll(1);
182 }
183 }
184
185 while (this.singleChatLines.size() > MinecraftFactory.getClassProxyCallback().getMaxChatLines()) {
186 this.singleChatLines.remove(this.singleChatLines.size() - 1);
187 }
188
189 if (!refresh) {
190 this.chatLines.add(0, new GuiChatLine(currentUpdateCounter, chatComponent, id));
191
192 while (this.chatLines.size() > MinecraftFactory.getClassProxyCallback().getMaxChatLines()) {
193 this.chatLines.remove(this.chatLines.size() - 1);
194 }
195 }
196
197 }
198
199 @Override
200 public void clear() {

Callers 2

printChatMessageMethod · 0.95
refreshChatMethod · 0.95

Calls 15

getClassProxyCallbackMethod · 0.95
deleteChatLineMethod · 0.95
getChatWidthMethod · 0.95
getChatScaleMethod · 0.95
getVarsMethod · 0.95
isChatOpenedMethod · 0.95
scrollMethod · 0.95
sizeMethod · 0.80
getMaxChatLinesMethod · 0.65
dMethod · 0.45

Tested by

no test coverage detected