Cancellable
interface Cancellable
Optional interface for events that support cancellation.
When a Cancellable event is posted, the bus stops dispatching as soon as isCancelled is true; remaining handlers are skipped.
class BlockBreakEvent : Event, Cancellable {
override var isCancelled = false
}Content copied to clipboard
Java: Kotlin compiles var isCancelled to isCancelled() / setCancelled(boolean):
public class BlockBreakEvent implements Event, Cancellable {
private boolean cancelled = false;
@Override public boolean isCancelled() { return cancelled; }
@Override public void setCancelled(boolean v) { cancelled = v; }
}Content copied to clipboard