MinecraftForge/MinecraftForge — pull request #1549 by tattyseal (2014-12-05 19:45:17+00:00)
Title: Added 2 new events for piston retraction and extension.

They are both cancellable and cause the retraction/extension not to happen when cancelled.

A simple example to prevent pistons from functioning at all.
https://gist.github.com/tattyseal/b487a75fce9a34ab1760

Both events provide whatever way the piston is facing. And all of the normal BlockEvent paramaters.