mojira.dev
MC-277718

Minecart behaviour altered even with experiments disabled

Minecart behaviour is different compared to 1.21.1 even when the "Minecarts Improvements" experiment is not enabled. I'm assuming this is unintended because it was not mentioned anywhere in any changelogs.
This bug negatively affects some sensitive redstone contraptions using minecarts made by the technical minecraft community.

Steps to reproduce

  • Download the attached world and open it in 1.21.1 or build the setup shown in the attached screenshot.

  • Flick the lever so that the dispenser spawns a minecart.

  • Observe how the minecart doesn't get destroyed by the lava cauldron.

  • Now open the world in 1.21.2-rc1 and repeat the previous steps.

  • Observe how the minecart ends up getting destroyed by the lava cauldron.

 

Attachments

Comments 1

Can confirm 1.21.2rc1
This happens because of the way how MC-276876 was fixed, previously (in 1.21) upon ticking, the cart would damage itself in 2 places in its tick, first here in the moveAlongTrack() method in the AbstracktMinecraft.java, (it calls enitity.move() which has the cauldron collision check in the tryCheckInsideBlocks() method thats within.) and the scond time the cart damages self upon executing the this.checkInsideBlocks(); within the tick() method in the AbstracktMinecraft.java
So 2 damage calls here and here:

[media]

But after the fix of MC-276876 the first damage call was moved to another place which changed the order of important stuff within the cart (and also boat) ticks.
Now it looks like this:

[media]


Notice that the cart no longer damages itself within the moveAlongTrack() method, previously it happened within the move() call within it, but entity.move() no longer does collision checks with cauldrons and such blocks in 1.21.2 rc1
The damage now happens 2 times, both within the .applyEffectsFromBlocks() method, thus the first damage call happans way later compared to where it was called in 1.21.

the fix for this issue should be simple: just move the duplicate applyEffectsFromBlocks() call from here

[media]

to here (right after the cart calls enity.move() on self, it deos so within the this.minecart.move() within the moveAlongTrack() method):

[media]

Please notice that the same exact issue happens to Boats, the fix for them is the same, just move the duplicate collision chechk to where it is logically supposed to be:

[media]

Also it is important to note that fixing the issue the way described above should make it so both this issue and the MC-276876 are fixed

CommandLeo

(Unassigned)

Community Consensus

Platform

Very Important

Entities, Minecart

1.21.2 Release Candidate 1

1.21.2 Release Candidate 2

Retrieved