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:
KingRainbow44 2023-08-27 23:23:42 -04:00
parent 154ace3d7e
commit 9bb3ec8916
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -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();
} }
} }