-
Bug
-
Resolution: Duplicate
-
None
-
1.14.4
-
None
-
Windows 10
Java 8
-
Unconfirmed
-
(Unassigned)
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.
- duplicates
-
MC-81098 Redstone dust updates cause lag
- Reopened