Mojira Archive
MC-11571

Huge lighting updates lag the game.

 The bug

This bug causes alot of light updates, dropping your FPS to 0 and most likely crashing your game.

This has been used for around a year now on several servers, this causes players to crash their game.

How to reproduce

  1. Create a new world (superflat, cheats on)
  2. Execute command: /fill ~20 ~200 ~-20 ~-20 ~200 ~20 stone
  3. Teleport yourself up to the platform. (/tp @a ~ ~205 ~)
  4. Place 2 observers facing into each other, make a hole 1 block away from the observer. (See screenshot for setup. the observers is to make a repeating redstone clock)
  5. Just place the piston so it pulls the block over the hole.
  6. Prepare yourself to see your FPS drop to 0.

Code analysis

The following is based on a decompiled version of Minecraft 1.12 using MCP940.

In the method net.minecraft.world.chunk.setBlockState() you have this~~

if (j >= i1)
{
this.relightBlock(i, j + 1, k);
}

which relight blocks, but this is causing the massive FPS drops. What this does is, if j (posY) is bigger then i1, it will relight the block on the X, Y + 1, Z the player is.

If you remove the '+ 1' this issue will be fixed. idk why though.

if (j >= i1) 
{ 
this.relightBlock(i, j, k); 
}

----------------------------------------------------------------------

When making a Creative world with bedrock at the bottom, air for most, and bedrock at the top, when you break the bedrock the game lags for about 7 seconds.

Example superflat preset: 3;minecraft:bedrock,250*minecraft:air,minecraft:bedrock;1;

I made a program that will take the "Something's taking too long!" messages and put it in a list. In the attached list, you can see that root.tick.level.connection is taking a VERY long time.

I hope this gets fixed soon, because it can be a huge exploit on servers.

^ original report