Skip to content

Commit

Permalink
Add context.blocks to the retract event, fixes #946
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 6, 2015
1 parent ebde22d commit c52ed00
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -574,6 +574,7 @@ public void blockPistonExtend(BlockPistonExtendEvent event) {
// <context.location> returns the dLocation of the piston.
// <context.retract_location> returns the new dLocation of the block that
// will be moved by the piston if it is sticky.
// <context.blocks> returns a dList of all block locations about to be moved.
// <context.material> returns the dMaterial of the piston.
// <context.sticky> returns an Element of whether the piston is sticky.
//
Expand All @@ -592,6 +593,11 @@ public void blockPistonRetract(BlockPistonRetractEvent event) {
context.put("material", material);
context.put("sticky", new Element(event.isSticky() ? "true": "false"));

dList blocks = new dList();
for (Block block: event.getBlocks())
blocks.add(new dLocation(block.getLocation()).identify());
context.put("blocks", blocks);

String determination = doEvents(Arrays.asList
("piston retracts",
material.identifySimple() + " retracts"),
Expand Down

0 comments on commit c52ed00

Please sign in to comment.