mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-12 23:14:38 +01: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:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user