2024-04-20 20:10:35 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Janet Blackquill <uhhadd@gmail.com>
Date: Sun, 7 Apr 2024 16:51:04 -0400
Subject: [PATCH] Add CartographyItemEvent
Similar to SmithItemEvent, but for cartography tables.
diff --git a/src/main/java/io/papermc/paper/event/player/CartographyItemEvent.java b/src/main/java/io/papermc/paper/event/player/CartographyItemEvent.java
new file mode 100644
2024-09-30 01:48:34 +02:00
index 0000000000000000000000000000000000000000..d5c67f5462b9011683ce742a197959f9c4380d40
2024-04-20 20:10:35 +02:00
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/CartographyItemEvent.java
2024-09-30 01:48:34 +02:00
@@ -0,0 +1,32 @@
2024-04-20 20:10:35 +02:00
+package io.papermc.paper.event.player;
+
+import org.bukkit.event.inventory.ClickType;
+import org.bukkit.event.inventory.InventoryAction;
+import org.bukkit.event.inventory.InventoryClickEvent;
2024-09-30 01:48:34 +02:00
+import org.bukkit.event.inventory.InventoryType;
+import org.bukkit.inventory.CartographyInventory;
+import org.bukkit.inventory.InventoryView;
2024-04-20 20:10:35 +02:00
+import org.jetbrains.annotations.ApiStatus;
2024-09-30 01:48:34 +02:00
+import org.jspecify.annotations.NullMarked;
2024-04-20 20:10:35 +02:00
+
+/**
+ * Called when the recipe of an Item is completed inside a cartography table.
+ */
2024-09-30 01:48:34 +02:00
+@NullMarked
2024-04-20 20:10:35 +02:00
+public class CartographyItemEvent extends InventoryClickEvent {
2024-09-30 01:48:34 +02:00
+
2024-04-20 20:10:35 +02:00
+ @ApiStatus.Internal
2024-09-30 01:48:34 +02:00
+ public CartographyItemEvent(final InventoryView view, final InventoryType.SlotType type, final int slot, final ClickType click, final InventoryAction action) {
2024-04-20 20:10:35 +02:00
+ super(view, type, slot, click, action);
+ }
+
+ @ApiStatus.Internal
2024-09-30 01:48:34 +02:00
+ public CartographyItemEvent(final InventoryView view, final InventoryType.SlotType type, final int slot, final ClickType click, final InventoryAction action, final int key) {
2024-04-20 20:10:35 +02:00
+ super(view, type, slot, click, action, key);
+ }
+
+ @Override
+ public CartographyInventory getInventory() {
+ return (CartographyInventory) super.getInventory();
+ }
+}