aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0216-Add-PlayerItemCooldownEvent.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-09-29 16:48:34 -0700
committerJake Potrebic <[email protected]>2024-09-29 19:13:41 -0700
commitba3c29b92ec29c8c321f7e6160a4a25f65f18088 (patch)
tree822022fb0a406a3c23533578de55ab8bcf5bd3e5 /patches/api/0216-Add-PlayerItemCooldownEvent.patch
parentea00be3aaa1a5727151db9cd82d876613c99e727 (diff)
downloadPaper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.tar.gz
Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.zip
Finish converting all events to jspecify annotations
Diffstat (limited to 'patches/api/0216-Add-PlayerItemCooldownEvent.patch')
-rw-r--r--patches/api/0216-Add-PlayerItemCooldownEvent.patch17
1 files changed, 7 insertions, 10 deletions
diff --git a/patches/api/0216-Add-PlayerItemCooldownEvent.patch b/patches/api/0216-Add-PlayerItemCooldownEvent.patch
index ae5118c7da..32321693b6 100644
--- a/patches/api/0216-Add-PlayerItemCooldownEvent.patch
+++ b/patches/api/0216-Add-PlayerItemCooldownEvent.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerItemCooldownEvent
diff --git a/src/main/java/io/papermc/paper/event/player/PlayerItemCooldownEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerItemCooldownEvent.java
new file mode 100644
-index 0000000000000000000000000000000000000000..c2764ffd51831351b934568e1301b2e4073dc0c4
+index 0000000000000000000000000000000000000000..07b3a93ea09f0ae7d0e7a5af3633a0c669d36fcf
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/PlayerItemCooldownEvent.java
-@@ -0,0 +1,82 @@
+@@ -0,0 +1,79 @@
+package io.papermc.paper.event.player;
+
+import com.google.common.base.Preconditions;
@@ -19,23 +19,23 @@ index 0000000000000000000000000000000000000000..c2764ffd51831351b934568e1301b2e4
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
-+import org.jetbrains.annotations.NotNull;
++import org.jspecify.annotations.NullMarked;
+
+/**
+ * Fired when a player receives an item cooldown.
+ */
++@NullMarked
+public class PlayerItemCooldownEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
-+ @NotNull
+ private final Material type;
+ private int cooldown;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
-+ public PlayerItemCooldownEvent(@NotNull Player player, @NotNull Material type, int cooldown) {
++ public PlayerItemCooldownEvent(final Player player, final Material type, final int cooldown) {
+ super(player);
+ this.type = type;
+ this.cooldown = cooldown;
@@ -46,7 +46,6 @@ index 0000000000000000000000000000000000000000..c2764ffd51831351b934568e1301b2e4
+ *
+ * @return material affected by the cooldown
+ */
-+ @NotNull
+ public Material getType() {
+ return this.type;
+ }
@@ -66,7 +65,7 @@ index 0000000000000000000000000000000000000000..c2764ffd51831351b934568e1301b2e4
+ *
+ * @param cooldown cooldown in ticks, has to be a positive number
+ */
-+ public void setCooldown(int cooldown) {
++ public void setCooldown(final int cooldown) {
+ Preconditions.checkArgument(cooldown >= 0, "The cooldown has to be equal to or greater than 0!");
+ this.cooldown = cooldown;
+ }
@@ -77,17 +76,15 @@ index 0000000000000000000000000000000000000000..c2764ffd51831351b934568e1301b2e4
+ }
+
+ @Override
-+ public void setCancelled(boolean cancel) {
++ public void setCancelled(final boolean cancel) {
+ this.cancelled = cancel;
+ }
+
-+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
-+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }