File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/main/java/net/minecraftforge/eventbus/api Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,7 @@ public boolean isCanceled() {
7373 * @param cancel The new canceled value
7474 */
7575 public void setCanceled (boolean cancel ) {
76- if (!isCancelable ())
77- {
76+ if (!isCancelable ()) {
7877 throw new UnsupportedOperationException (
7978 "Attempted to call Event#setCanceled() on a non-cancelable event of type: "
8079 + this .getClass ().getCanonicalName ()
@@ -87,6 +86,13 @@ public void setCanceled(boolean cancel) {
8786 isCanceled = cancel ;
8887 }
8988
89+ /**
90+ * Equivalent to calling {@link #setCanceled(boolean)} with {@code true}.
91+ */
92+ public void cancel () {
93+ setCanceled (true );
94+ }
95+
9096 /**
9197 * Determines if this event expects a significant result value.
9298 *
You can’t perform that action at this time.
0 commit comments