Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-93129

Falling sand behaves incorrectly in lazy chunks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 17w47a
    • Minecraft 15w47c, Minecraft 15w50a, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w36a, Minecraft 16w44a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12
    • Confirmed

      This report is based on

      Introduction

      I really don't want to ruin what panda4994 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.

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: