The bug
When using the new /tellraw
command I kept clicking it and as the message rose above the visible messages in chat, when I hover over where the pop up would appear it appears and it is still click-able for 2 more times.
Also affects hoverEvents
.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 2
Attachments
Comments 12
This issue is still unresolved and i recorded a video showing the bug. I use the command /tellraw @p {"text":"test","color":"blue","clickEvent":{"action":"run_command","value":"/give @p minecraft:dirt"}} and click the test button as far as i can go. As you can see in the video it goes 3 over what it is meant to.
https://www.youtube.com/watch?v=3JxwBrr44TA&feature=youtu.be
Confirmed for
15w50a
The reason for that is that in the getChatComponent(int p_146236_1_, int p_146236_2_)
method of the /Client/src/net/minecraft/client/gui/GuiNewChat.java
class (MCP 1.8 names) the number of visible lines was added to the the calculated visible chat height. Removing this fixed the problem. However the fact that the methods calculateChatboxWidth(float p_146233_0_)
and calculateChatboxHeight(float p_146243_0_)
are partwise used is problematic as they do not consider the custom chat settings (for example Minecraft.getMinecraft().gameSettings.chatWidth
).
public IChatComponent getChatComponent(int p_146236_1_, int p_146236_2_)
{
if (!this.getChatOpen())
{
return null;
}
else
{
//...
if (var6 >= 0 && var7 >= 0)
{
int var8 = Math.min(this.getLineCount(), this.field_146253_i.size());
// Changed this
//if (var6 <= MathHelper.floor_float((float)this.getChatWidth() / this.getChatScale()) && var7 < this.mc.fontRendererObj.FONT_HEIGHT * var8 + var8)
if (var6 <= MathHelper.floor_float((float)this.getChatWidth() / this.getChatScale()) && var7 < this.mc.fontRendererObj.FONT_HEIGHT * var8)
{
//...
return null;
}
else
{
return null;
}
}
else
{
return null;
}
}
}
Confirmed. Use this command for testing: