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

Method setChatLine

Minecraft-Utils/1.8.9/src/Gui2ndChat.java:173–206  ·  view source on GitHub ↗
(eu chatComponent, int id, int currentUpdateCounter, boolean refresh)

Source from the content-addressed store, hash-verified

171 }
172
173 private void setChatLine(eu chatComponent, int id, int currentUpdateCounter, boolean refresh) {
174 if (!refresh && MinecraftFactory.getClassProxyCallback().isShowTimeBeforeChatMessage()) {
175 chatComponent = (eu) MinecraftFactory.getClassProxyCallback().getChatComponentWithTime(chatComponent);
176 }
177 if (id != 0) {
178 this.deleteChatLine(id);
179 }
180
181 int lineWidth = ns.d((float) this.getChatWidth() / this.getChatScale());
182 List<eu> lines = avu.a(chatComponent, lineWidth, ((Variables) MinecraftFactory.getVars()).getFontrenderer(), false, false);
183 boolean var6 = this.isChatOpened();
184
185 eu lineString;
186 for (Iterator<eu> iterator = lines.iterator(); iterator.hasNext(); this.singleChatLines.add(0, new GuiChatLine(currentUpdateCounter, lineString, id))) {
187 lineString = iterator.next();
188 if (var6 && this.scrollPos > 0) {
189 this.isScrolled = true;
190 this.scroll(1);
191 }
192 }
193
194 while (this.singleChatLines.size() > MinecraftFactory.getClassProxyCallback().getMaxChatLines()) {
195 this.singleChatLines.remove(this.singleChatLines.size() - 1);
196 }
197
198 if (!refresh) {
199 this.chatLines.add(0, new GuiChatLine(currentUpdateCounter, chatComponent, id));
200
201 while (this.chatLines.size() > MinecraftFactory.getClassProxyCallback().getMaxChatLines()) {
202 this.chatLines.remove(this.chatLines.size() - 1);
203 }
204 }
205
206 }
207
208 @Override
209 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