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

Method setChatLine

Minecraft-Utils/1.10.2/src/Gui2ndChat.java:167–200  ·  view source on GitHub ↗
(ey chatComponent, int id, int currentUpdateCounter, boolean refresh)

Source from the content-addressed store, hash-verified

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