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

Method setChatLine

Minecraft-Utils/1.8/src/Gui2ndChat.java:160–193  ·  view source on GitHub ↗
(ho chatComponent, int id, int currentUpdateCounter, boolean refresh)

Source from the content-addressed store, hash-verified

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