Waterfall/BungeeCord-Patches/0024-Add-callEvent-shortcut-to-Event.patch
Shane Freeder 25ecd402f3
Updated Upstream (BungeeCord)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
1a807731 #3567: Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3
772ad995 #3566: Bump actions/setup-java from 3 to 4
2431c40a #3562: Bump io.netty:netty-bom from 4.1.100.Final to 4.1.101.Final
8144ae8d #3555: Bump com.mysql:mysql-connector-j from 8.1.0 to 8.2.0
0757c39a Attempt upgrade of resolver libraries
2023-12-13 15:18:04 +00:00

33 lines
1.1 KiB
Diff

From 3c8fdc59280303fcca5b51c9b78fc02a1886e716 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Sun, 14 Apr 2019 19:15:00 +0300
Subject: [PATCH] Add callEvent() shortcut to Event
diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/Event.java b/api/src/main/java/net/md_5/bungee/api/plugin/Event.java
index e2e01ecb..25ec1bd8 100644
--- a/api/src/main/java/net/md_5/bungee/api/plugin/Event.java
+++ b/api/src/main/java/net/md_5/bungee/api/plugin/Event.java
@@ -12,4 +12,18 @@ public abstract class Event
public void postCall()
{
}
+ // Waterfall start - Add callEvent() shortcut, borrowed from PaperMC/Paper
+ /**
+ * Calls the event and tests if cancelled.
+ *
+ * @return false if event was cancelled, if cancellable. otherwise true.
+ */
+ public final boolean callEvent() {
+ net.md_5.bungee.api.ProxyServer.getInstance().getPluginManager().callEvent(this);
+ if (this instanceof Cancellable) {
+ return !((Cancellable) this).isCancelled();
+ }
+ return true;
+ }
+ // Waterfall end
}
--
2.43.0