Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jckf/pistonfix
Restore pre-1.8 behavior to BlockPistonRetractEvent.
https://github.com/jckf/pistonfix
Last synced: 13 days ago
JSON representation
Restore pre-1.8 behavior to BlockPistonRetractEvent.
- Host: GitHub
- URL: https://github.com/jckf/pistonfix
- Owner: Jckf
- Created: 2016-06-15T07:59:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-15T08:16:12.000Z (over 8 years ago)
- Last Synced: 2024-11-08T12:50:47.378Z (2 months ago)
- Language: Java
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PistonFix
Behavior of the BlockPistonRetractEvent was changed when Spigot updated
CraftBukkit to Minecraft 1.8. This new behavior can be very confusing, and
outright breaks existing plugins. See
[SPIGOT-117](https://hub.spigotmc.org/jira/browse/SPIGOT-117).The problem is an additional trigger of BlockPistonRetractEvent for non-sticky
pistons, causing plugins to see the same piston retract twice in a row. This
plugin works around that by cancelling the second event in a LOWEST priority
handler, and then uncancelling it again in a MONITOR priority event handler.
This means plugins running on the same server as PistonFix will still see two
BlockPistonRetractEvents, but the second one will be cancelled for all handlers
that are not at LOWEST priority. Behavior for such handlers is undefined.In summary, this means you can ignore the extraneous event by setting
`ignoreCancelled=true` on your BlockPistonRetractEvent handler like so:```java
@EventHandler(ignoreCancelled=true)
public void onBlockPistonRetract(BlockPistonRetractEvent) {
// I will only trigger once per actual retract :)
}
```