The bug
I was fighting with guardians and the fight is not how it was before - guardian beam rendering stopped working. Only bubbles render now.
This happens when the game time reaches 2800000
.
Download the MC-165595 world attachment if you want to reproduce this.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 14
relates to 4
Attachments
Comments 22
1.15.1 is already marked as affected, and I can reproduce this in 1.15.1 too. So this still is a problem for some players.
This happens in one of my worlds but not the other. It's quite annoying. Vanilla or not, resource packs or not, it still doesn't show. (in 1.15.2)
Also happened to me. Went to explore a Woodland Mansion and during the journey, I found an Ocean Monument. Tried to reproduce this and it happened. However, in creative, this doesn't work. You will see the beam normally, however, it is dark (MC-168398) Also, it is annoying. If you are above water, you do not know if it is attacking you, because you don't even see the bubbles (reason: MC-161917, which is very annoying.)
Welp, now I'm getting this issue. Apparently it doesn't happen in new worlds but will always not render on old worlds.
The bug is still unresolved on 1.18.1. I encounter it on a self-owned private Minecraft Vanilla server. I have checked the "Time" in level.dat is 21396082, seems not only happen at power of two values.
As mentioned by @unknown, the reason this issue occurs is because of an integer overflow, caused by float
to int
conversions inside Mth.cos()
and Mth.sin()
. More specifically, it should overflow when the world time is above approximately 2745160 (might be slightly more or less than that), as that is the earliest number that would cause an overflow within GuardianRenderer#render(...)
:
...
float $$8 = (float)$$0.level.getGameTime() + $$2;
...
float $$18 = $$8 * 0.05f * -1.5f;
...
float $$31 = Mth.cos($$18 + 5.4977875f) * 0.282f;
...
GuardianRenderer.vertex($$46, $$48, $$49, $$31, $$41, $$32, $$20, $$21, $$22, 1.0f, $$50);
...
Is this fixed for someone? If is, mark as Fixed. It is fixed for me