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.
Linked issues
is cloned by 1
is duplicated by 3
Attachments
Comments 10
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.
Hope It Fixed! 🙂