mojira.dev
MC-164476

Redstone Dust causes a ton of block updates when being unpowered

I just recently was made aware of this, so I decided to inject a println statement into updateNeighborsAlways() (a method that updates a block's 6 neighbors, and is called in the redstone dust update code, I'm not sure what it's official mapping is). The code I used is as follows:

package com.camellias.mlpbim.mixin;import org.spongepowered.asm.mixin.Mixin;

import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import net.minecraft.block.Block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;@Mixin(World.class)

public abstract class TestMixin
{
	@Inject(method = "updateNeighborsAlways", at = @At("HEAD"))
	private void inject(BlockPos blockPos_1, Block block_1, CallbackInfo info)
	{
		System.out.println(block_1 + " updated pos " + blockPos_1 + " during " + ((World) ((Object) this)).getTime());
	}
}

The mixin just injects the specified method (in this case updateNeighborsAlways()) in the specified class (World) at where ever I specified (in this case at the very beginning of the method). The parameters are the parameters of updateNeighborsAlways() plus CallbackInfo, as that's required for a mixin to work properly. The code injected is whatever I put inside the inject() method, which in this case is just a println so I can see what is updating when.

I then proceeded to place down 15 pieces of redstone dust in a straight line, and power it with a lever.

When I powered the redstone, it (the redstone dust, not the lever) only updated 105 times in a single tick, as expected (6 for the blocks around it plus itself, multiplied by 15, the amount of redstone dust).

However, when unpowering it, the dust updated 448 times in a tick, which is more than 4 times then it should be. I'll attach the .txt files containing the results from both powering and unpowering the redstone below, as well as a screenshot of my setup.

EDIT: I also forgot to mention. With only 7 redstone dust, it updated 308 times, so it appears the amount of updates it does is proportional with the power of the dust.

Related issues

Attachments

Comments

migrated
[media][media][media]
violine1101

Thank you for your report!
We're actually already tracking this issue in MC-81098, so I resolved and linked this ticket as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki

migrated

(Unassigned)

Unconfirmed

(Unassigned)

1.14.4

Retrieved