mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 01:06:01 +01:00
SPIGOT-759: Add FireworkExplodeEvent.
By: DemonWav <demonwav@gmail.com>
This commit is contained in:
parent
35cdd66272
commit
107ff2ff80
1 changed files with 49 additions and 0 deletions
|
@ -0,0 +1,49 @@
|
|||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Firework;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a firework explodes.
|
||||
*/
|
||||
public class FireworkExplodeEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancel;
|
||||
|
||||
public FireworkExplodeEvent(final Firework what) {
|
||||
super(what);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the cancelled state of this event. If the firework explosion is
|
||||
* cancelled, the firework will still be removed, but no particles will be
|
||||
* displayed.
|
||||
*
|
||||
* @param cancel whether to cancel or not.
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Firework getEntity() {
|
||||
return (Firework) super.getEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue