mojira.dev
MC-89428

Rails update other rails before checking if they are in a valid location when moved by pistons

If you power a piston with 3 rail infront of the piston head, This happen.
If you tries to update the rail, The rail will destroy itself.


Code analysis by @unknown can be found in this comment.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media][media][media][media][media][media][media][media]
migrated

Hope It Fixed! 🙂

migrated

Please attach screenshots showing the setup before and after.

migrated

Ok!

migrated

Reopened and confirmed.

marcono1234

Confirmed for

  • 15w40b

marcono1234

Confirmed for

  • 16w07a

marcono1234

Please link to this comment in the description

The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.

The reason why this happens is that the methods public void clearPistonTileEntity() and public void update() of the net.minecraft.tileentity.TileEntityPiston class which place the moved block do not test if the block can be placed at the new position. However after they placed it they call the public void notifyBlockOfStateChange(BlockPos pos, final Block blockIn) method of the net.minecraft.world.World class to update the block. This causes the block to drop as item in case the block cannot be placed at this position. Because of how rails work once their onBlockAdded(World worldIn, BlockPos pos, IBlockState state) method is called they try to connect to other rails already, which happens before the updating method is called.
Having this "rotating based on other rails around" part in the public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) method creates new problems.

migrated

Is this still a problem in Minecraft 1.11?

migrated

@unknown I think it is. I tried this bug in Minecraft 17w06a, and it's still works!

migrated

Seems like this bug doesn't happen to me anymore in the latest 1.13 snapshot

migrated

(Unassigned)

Confirmed

block-update, piston, rail

Minecraft 15w39c, Minecraft 15w40b, Minecraft 15w43c, Minecraft 15w44a, Minecraft 15w50a, ..., Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 17w48a

Minecraft 18w03b

Retrieved