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

Method setChatLine

Minecraft-Utils/1.13/src/Gui2ndChat.java:163–196  ·  view source on GitHub ↗
(ij chatComponent, int id, int currentUpdateCounter, boolean refresh)

Source from the content-addressed store, hash-verified

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