This document is meant to be read after reading the explanation of 1.5 piston mechanics. I also recommend watching Myren Eario's video on block events.
When a piston is updated and finds itself in conditions where a retraction is suitable, it will set itself to retracted immediately, even before scheduling the retraction block event. This allows for a lot of weird things.
In the comments of the bug report for semi-retraction, Jeb seems to imply that this behaviour was intended to make double piston extenders easier to build.
A very well known application of semi-retraction is the so-called double retraction. This happens when you retract a piston that is in the semi-retracted state. The timeline for scheduling the block events is the following, where piston #1
is the piston pulling piston #2
:
#1 depower, schedule retraction
#2 depower, schedule retraction (extended => retracted)
#1 process retraction
Pulling a semi-retracting piston is very simple because the scheduling of a retraction cannot fail. This is not the case with extensions. If we were to take double retraction and simply replace the #1
retraction with an extension, we would end up with the following:
#1 power, schedule extension fails <--- PROBLEM!
#2 depower, schedule retraction (extended => retracted)
===
#2 process retraction
The extended piston is immovable and this extension scheduling for piston #1
will fail. We need the piston to not be extended when we schedule the push. The following is the easiest way:
#2 power, schedule extension
#2 schedule BE for depower
#1 power, schedule extension
===
#2 process extension (retracted => extended)
#2 depower, schedule retraction (extended => retracted)
#1 process extension
One can use this to have a single piston moving multiple rows of blocks as seen in a video by Mxi10.
This is not quite the same as double retraction however. We start with a retracted piston rather than an extended one. We can achieve something similar by semiretracting the piston before scheduling the block event too. The retraction can then be prevented by powering the piston again in time taking advantage of block event cancellation.
#2 schedule BE for power
#2 depower, schedule retraction (extended => retracted)
#2 schedule BE for depower
#1 power, schedule extension
===
#2 power, schedule extension
#2 process retraction, revert to extended (retracted => extended)
#2 depower, schedule retraction (extended => retracted)
#1 process extension