mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-09 05:36:05 +08:00
Change the result of call
to a boolean
Returns true if logic execution should continue, false if logic condition should terminate
This commit is contained in:
parent
154ace3d7e
commit
9bb3ec8916
@ -17,9 +17,15 @@ public abstract class Event {
|
|||||||
else throw new UnsupportedOperationException("Event is not cancellable.");
|
else throw new UnsupportedOperationException("Event is not cancellable.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Pushes this event to all listeners. */
|
/**
|
||||||
public void call() {
|
* Pushes this event to all listeners.
|
||||||
|
*
|
||||||
|
* @return True if execution should continue. False if execution should cancel.
|
||||||
|
*/
|
||||||
|
public boolean call() {
|
||||||
var pluginManager = Grasscutter.getPluginManager();
|
var pluginManager = Grasscutter.getPluginManager();
|
||||||
if (pluginManager != null) pluginManager.invokeEvent(this);
|
if (pluginManager != null) pluginManager.invokeEvent(this);
|
||||||
|
|
||||||
|
return !this.isCanceled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user