Added ability to explicitly define asynchronous PremadeEvent (#763)

* Add ability to define asynchronous event

* minor formatting

* Removed another line jump
This commit is contained in:
BONNe 2019-06-14 14:59:47 +03:00 committed by Florian CUNY
parent 3c1f033819
commit d1e9188959

View File

@ -8,6 +8,24 @@ import org.bukkit.event.HandlerList;
*/
public abstract class PremadeEvent extends Event {
/**
* The default constructor is defined for cleaner code.
* This constructor assumes the PremadeEvent is synchronous.
*/
public PremadeEvent() {
this(false);
}
/**
* This constructor is used to explicitly declare an PremadeEvent as synchronous or asynchronous.
* @param async - true indicates the event will fire asynchronously, false
* by default from default constructor
* @since 1.5.2
*/
public PremadeEvent(boolean async) {
super(async);
}
private static final HandlerList handlers = new HandlerList();
@Override