-
Bug
-
Resolution: Unresolved
-
None
-
1.19.2, 22w42a, 1.21
-
None
-
Minecraft Version: 1.19.2
Minecraft Version ID: 1.19.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 17.0.4.1, Eclipse Adoptium
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Eclipse Adoptium
Processor Name: AMD Ryzen 9 3900XT 12-Core Processor
Graphics card #0 name: NVIDIA GeForce RTX 2080 SUPER
Minecraft Version: 1.19.2 Minecraft Version ID: 1.19.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 17.0.4.1, Eclipse Adoptium Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Eclipse Adoptium Processor Name: AMD Ryzen 9 3900XT 12-Core Processor Graphics card #0 name: NVIDIA GeForce RTX 2080 SUPER
-
Confirmed
-
Rendering
-
Normal
-
Platform
When pistons push walls of blocks a shadow is shown while the blocks are moving, due to the blocks moving only for one tick the shadow appears to blink which is not pleasant to look at. This is odd specifically because the shadow is present only on the front face of the block while it is being pushed through air.
The sides of the block being incorrectly lit until the pistons finish moving is not an issue (MC-255048), this is strictly about the front face of the block having a shadow when it should not have since there are no other blocks to cause the shadow.
The attached video shows the current situation for the first 8 seconds, after that a code change is hotswapped that to show what it should look like instead.
Code Analysis
For each block being pushed by a piston we have the source and target block. The moving block entity uses the location of the source block to get rendering information like the block lighting, random texture variation (seed) and biome coloration. As per MC-255048 changing this to use the target block is not correct, understandibly since this changes the aforementioned factors. However, this creates a problem with lighting as the moving block is placed on the target block. The moving block inherits the collision shape from the moved block state, so if this is a full block it inherits `isCollisionShapeFullBlock` returning true which causes a shadow. So the shadow on the front face of the pushed wall is due to the new moving block casting a shadow on its own source block.
A possible fix is to override `isCollisionShapeFullBlock` in `MovingPistonBlock` to always return false which seems to fix the issue but might not be the perfect solution since it could affect other rendering details. The fix to this issue involves some modification to how moving blocks render to remove this shadow cast by the moving block onto itself, either by overriding the specific front face or through changing whether the collision shape is seen as a full block.
Specifically concering the provided video, the solution it uses simply changes the moving block entity to use the target block's position which is not the preferred fix as per MC-255048. So any minor visual differences with the video can be ignored, it's just for illustration of what it should look like.
- relates to
-
MC-255048 The faces of blocks retain the light levels of their original position for a short period of time when falling or being pushed by pistons
- Resolved