From e2a19cbc74030579529344b59c40ba1b2ba04f1f Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 10 Jun 2024 19:18:14 -0700 Subject: [PATCH] Add helpers to Event.Result. --- src/main/java/net/minecraftforge/eventbus/api/Event.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/eventbus/api/Event.java b/src/main/java/net/minecraftforge/eventbus/api/Event.java index 259a99b..f6bbca8 100644 --- a/src/main/java/net/minecraftforge/eventbus/api/Event.java +++ b/src/main/java/net/minecraftforge/eventbus/api/Event.java @@ -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;