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

Method setChatLine

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

Source from the content-addressed store, hash-verified

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