mojira.dev
MC-93129

Falling sand behaves incorrectly in lazy chunks

This report is based on

Introduction

I really don't want to ruin what @unknown did, but in my opinion this bug can also cause pretty great problems as it is inconsistent.

Lazy chunks are chunks are chunks where only redstone is processed, but entities are not. These lazy chunks are chunks that have less than 24 loaded chunks around them in a square area (itself in the middle).

Incorrect timing

As you can see in the second video falling sand in lazy chunks just instantly gets placed where it would land.

Loss of data value

You can see the first value that falling sand in lazy chunks loses its data value, which means that for example red sand becomes sand or damage anvils become unused ones. This could be easily fixed, however I strongly dislike this concept of different sand behaviour in lazy chunks in general.

The reason for this is that the default state of the block is used in the checkFallable(World worldIn, BlockPos pos) method of the /Client/src/net/minecraft/block/BlockFalling.java class (MCP 1.8 name).
This would be a possible fix:

private void checkFallable(World worldIn, BlockPos pos)
{
	if (canFallInto(worldIn, pos.offsetDown()) && pos.getY() >= 0)
	{
		byte var3 = 32;

		if (!fallInstantly && worldIn.isAreaLoaded(pos.add(-var3, -var3, -var3), pos.add(var3, var3, var3)))
		{
			//...
		}
		else
		{
			// Added
			IBlockState blockState = worldIn.getBlockState(pos);
			
			worldIn.setBlockToAir(pos);
			BlockPos var4;

			for (var4 = pos.offsetDown(); canFallInto(worldIn, var4) && var4.getY() > 0; var4 = var4.offsetDown())
			{
				;
			}

			if (var4.getY() > 0)
			{
				// Added
				worldIn.setBlockState(var4.offsetUp(), blockState);
				//worldIn.setBlockState(var4.offsetUp(), this.getDefaultState());
			}
		}
	}
}

How to reproduce

  1. Use the following command, replace [x] with: renderDistance * 16 (For example your render distance is 8: 8 * 16 = 128)

    /setblock ~[x] ~1 ~ sand 1
  2. Go to where the sand was placed
    If it had air below it, it will be now normal sand instead of red sand

Incorrect landing behaviour

You can see in the second video, that falling sand in lazy chunks behaves differently than normal. For example it just gets placed on the first block that is not air. This means that it will not break when landing on transparent blocks or gets placed in midair on a torch instead of falling through it.

Linked issues

Comments 6

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.

This is an automated comment on any open or reopened issue with out-of-date affected versions.

I don't think so. This one involves chunk loading, but not metadata, the other one is about metadata and has nothing to do with chunk loading. Or am I wrong?

No they might be only related by their topic (falling sand and meta data) but not by their respective cause.

The apparent cause - two falling sand entities at the same location for once and falling sand entity in lazy chunks - might be different but there are a lot of parallels. Falling sand entities in lazy chunks also loose their data value so there might be a common part to both under the hood.

And also, I guess this boosts both this and MC-81746, and TBH I think it's quite a significant bug now with concrete in the game.

Just saw this repro on 1.12 on Mac Realms, put green concrete powder on ice from frost walker boots and left, when I came back the concrete was solid, white, and at the bottom of the ocean .

edit: first concrete -> concrete powder

marcono1234

(Unassigned)

Confirmed

chunk, chunkloading, falling_block

Minecraft 15w47c, Minecraft 15w50a, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w36a, Minecraft 16w44a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12

Minecraft 17w47a

Retrieved