Affects Version/s: Minecraft 1.8.8, Minecraft 15w36b, Minecraft 15w36c, Minecraft 15w36d, Minecraft 15w37a
Fix Version/s: Minecraft 15w38a
When blocks are retracted by a piston they don't move (or bounce in the case of slime blocks) entities.
What I expected to happen was...:
Blocks that are moved by pistons should move entities the same way no matter if retracting or extending.
What actually happened was...:
Retracting blocks barely move the entities in front of them. Also they move them in the wrong direction.
Steps to Reproduce:
(1 to 3 is just building up 2015-09-05_01.08.38.png)
1. Place a sticky piston and power it.
2. Place a slime block in front of it and a block/slime block on the side of that slime block. (Make sure the floor doesn't stick to the slime block)
3. Summon/Place an armor stand in the spot where the block you just placed would be when the piston was retracted.
4. Remove the power source and let the piston retract.
5. See how the armor stand only moves a little bit and in the wrong direction (2015-09-05_01.08.45.png)
Video (showing a similar way to reproduce the issue): https://youtu.be/ZkI3uU7hoBA?t=3m1s
The reason for the bug is that the piston tile entity is often making differences between extending and retracting pistons where they really just should work exactly the same with an inverted facing.
(The only case where I believe that an actual difference is needed is for the piston arm, and that should be mostly (or even purely?) be rendering.)
So I removed all dependencies on "this.extending" in the parts of code that is moving the entities and replaced the facing with the actually push direction of the piston.
Here is the changed code. Or to make it easier to see the difference: https://github.com/Panda4994/Minecraft-Bugfixes/commit/dc46dd61eadc39729230cf6554c9adacd345ccdb#diff-20737173869e706ea6189fd5fe9f2e49 (I only posted the needed methods, hopefully the rest I clear from context)
Link to the mentioned other post:
After changing this it worked better, but to my surprise it still didn't fully work. Looking around I found that the code to get the collision box of a moving block looks similar to what we just changed.
So I also made that depended on the actual facing instead of messing with the values when the piston is retracting.
Please note that the collision boxes (especially for moving blocks) need some more refactoring. Check
MC-73302 for additional information.
And the diff again: https://github.com/Panda4994/Minecraft-Bugfixes/commit/909b6c12204fc2f5d1d40d6918ebcbdd4f6e0d84#diff-8c85c5cb2ca98cf6d0f56ca85846ea55
This bug has been posted three times before:
MC-75219, MC-74184 and MC-54954
However all of these are quite old, less detailed and don't get updated to the current versions. So I thought I might just repost it with additional information and try to keep it updated