mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
support plugins calling OBC directly for inventory close event
This commit is contained in:
parent
2df786eb1f
commit
2cde0e40c3
1 changed files with 11 additions and 3 deletions
|
@ -168,16 +168,24 @@ index fd47065c6..53f973615 100644
|
|||
|
||||
// Check if the fromWorld and toWorld are the same.
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 248873fb4..c6f447205 100644
|
||||
index 248873fb4..cce4acc0b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
- public static void handleInventoryCloseEvent(EntityHuman human) {
|
||||
- InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView());
|
||||
+ // Paper start
|
||||
+
|
||||
+ /**
|
||||
+ * Incase plugins hooked into this or Spigot adds a new inventory close event. Prefer to pass a reason
|
||||
+ * @param human
|
||||
+ */
|
||||
+ @Deprecated
|
||||
public static void handleInventoryCloseEvent(EntityHuman human) {
|
||||
- InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView());
|
||||
+ handleInventoryCloseEvent(human, org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNKNOWN);
|
||||
+ }
|
||||
+ public static void handleInventoryCloseEvent(EntityHuman human, org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) {
|
||||
+ InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView(), reason);
|
||||
+ // Paper end
|
||||
|
|
Loading…
Add table
Reference in a new issue