Skip to content

Commit

Permalink
Add helpers to Event.Result.
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Jun 11, 2024
1 parent 9ce967e commit e2a19cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/net/minecraftforge/eventbus/api/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ public class Event {
public enum Result {
DENY,
DEFAULT,
ALLOW
ALLOW;

public boolean isDefault() { return this == Result.DEFAULT; }
public boolean isDenied() { return this == Result.DENY; }
public boolean isAllowed() { return this == Result.ALLOW; }
}

private boolean isCanceled = false;
Expand Down

0 comments on commit e2a19cb

Please sign in to comment.