mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
2f782a6652
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes:17543ecf
SPIGOT-5035: Error Using Virtual Merchant GUI0fc6922b
SPIGOT-5028: Villager#setVillagerExperience() doesn't workbdbdbe44
SPIGOT-5024: Fox error - Unknown target reason
37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
From 0272169024ee505ee1592d5ecccc89b758d444b7 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sun, 19 May 2013 20:36:58 -0400
|
|
Subject: [PATCH] Add a call helper to Event
|
|
|
|
Reduces diff in Server patches
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
|
|
index 18d0636b7..8ec56cd6b 100644
|
|
--- a/src/main/java/org/bukkit/event/Event.java
|
|
+++ b/src/main/java/org/bukkit/event/Event.java
|
|
@@ -35,6 +35,22 @@ public abstract class Event {
|
|
this.async = isAsync;
|
|
}
|
|
|
|
+ // Paper start
|
|
+ /**
|
|
+ * Calls the event and tests if cancelled.
|
|
+ *
|
|
+ * @return false if event was cancelled, if cancellable. otherwise true.
|
|
+ */
|
|
+ public boolean callEvent() {
|
|
+ org.bukkit.Bukkit.getPluginManager().callEvent(this);
|
|
+ if (this instanceof Cancellable) {
|
|
+ return !((Cancellable) this).isCancelled();
|
|
+ } else {
|
|
+ return true;
|
|
+ }
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
/**
|
|
* Convenience method for providing a user-friendly identifier. By
|
|
* default, it is the event's class's {@linkplain Class#getSimpleName()
|
|
--
|
|
2.21.0
|
|
|