mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-20 10:18:16 +02:00
switch to JSpecify annotations
This commit is contained in:
@@ -6,7 +6,7 @@ Subject: [PATCH] PlayerBookTooLargeEvent
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java b/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a176a234d5
|
||||
index 0000000000000000000000000000000000000000..31cce9f4e398135016114b96254376325a22ba7c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/player/PlayerBookTooLargeEvent.java
|
||||
@@ -0,0 +1,65 @@
|
||||
@@ -17,11 +17,13 @@ index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a1
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a player tries to bypass book limitations
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class PlayerBookTooLargeEvent extends PlayerEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final ItemStack book;
|
||||
@@ -31,7 +33,8 @@ index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a1
|
||||
+ * @param player The player
|
||||
+ * @param book The book
|
||||
+ */
|
||||
+ public PlayerBookTooLargeEvent(@NotNull Player player, @NotNull ItemStack book) {
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerBookTooLargeEvent(Player player, ItemStack book) {
|
||||
+ super(player, !Bukkit.isPrimaryThread());
|
||||
+ this.book = book;
|
||||
+ }
|
||||
@@ -41,7 +44,6 @@ index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a1
|
||||
+ *
|
||||
+ * @return The book
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ItemStack getBook() {
|
||||
+ return book;
|
||||
+ }
|
||||
@@ -65,12 +67,10 @@ index 0000000000000000000000000000000000000000..c88394336bc9ab0f66a2af24d393f4a1
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user