[SPIGOT-822] the BlockPistonRetractEvent BlockFace getDirection() for Sticky Piston is Opposite Created: 20/Apr/15  Updated: 13/Oct/16

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Meano Assignee: md_5
Resolution: Unresolved Votes: 0
Labels: 1.8, bug, bukkit, event, spigot
Environment:

Java 8 Linux or Windows


Attachments: JPEG File 1.jpg     JPEG File 2.jpg     JPEG File 3.jpg    
Issue Links:
Duplicate
is duplicated by SPIGOT-2728 PistonRetractEvent has wrong directio... Resolved
is duplicated by SPIGOT-836 Some sticky pistons don't retract blocks Closed
Plugin: none

 Description   

this bug has already existed for a long time
1.make a plugin like 3.jpg
2.place TNT(or any other Type of Block),Sticky Piston,Sticky Piston(or any other can be Retract Block) like 1.jpg
3.Retract Block,the Message will display in Screen like 2.jpg
the getDirection() block is not same to getblocks() block



 Comments   
Comment by PseudoKnight [ 04/Jun/15 ]

Also, getRetractLocation() returns the incorrect location based on the opposite direction. No doubt this encouraged the view point that the direction was incorrect as well. But it looks like that method was deprecated at some point. Still, it caused some problems with plugins using this event.

Comment by md_5 [ 04/Jun/15 ]

Ok so basically:
1) Server never used to fire a retract event for sticky pistons, only an extend event which moved the blocks backwards (not really logical but whatever).
2) Server now does fire a retract event for sticky pistons as of 1.8
3) The documentation for "piston event" says ""Return the direction in which the piston will operate."
4) Based on my interpretation of this documentation, which hasn't changed, the direction is the direction in which the piston moves the blocks. So for a piston facing North, it will Extend North and Retract south.

If no one has any issues with this, I would like to amend the javadoc and then consider this issue solved.

Comment by Meano [ 20/Apr/15 ]

The founction's description in JavaDoc is "Return the direction in which the piston will operate." and returned the direction of the piston. when BlockPistonRetractEvent called by the normal piston,the relative block in that direction is the PISTON_EXTENSION.

Comment by Black Hole [ 20/Apr/15 ]

Works as indented. Direction is direction the blocks are moved.
The blocks are moved to the left. So the relative block in that direction is the TNT block.

Comment by SpigotMC [ 20/Apr/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 22 version(s) behind. CraftBukkit is 48 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Mon Apr 21 21:46:28 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.