mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 05:32:18 -07:00
Finish converting all events to jspecify annotations
This commit is contained in:
@@ -16,20 +16,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when the server detects a player stopping using an item.
|
||||
+ * Examples of this are letting go of the interact button when holding a bow, an edible item, or a spyglass.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class PlayerStopUsingItemEvent extends PlayerEvent {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @NotNull private final ItemStack item;
|
||||
+ private final ItemStack item;
|
||||
+ private final int ticksHeldFor;
|
||||
+
|
||||
+ public PlayerStopUsingItemEvent(@NotNull final Player player, @NotNull final ItemStack item, final int ticksHeldFor) {
|
||||
+ public PlayerStopUsingItemEvent(final Player player, final ItemStack item, final int ticksHeldFor) {
|
||||
+ super(player);
|
||||
+ this.item = item;
|
||||
+ this.ticksHeldFor = ticksHeldFor;
|
||||
@@ -40,7 +41,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return ItemStack the exact item the player released
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ItemStack getItem() {
|
||||
+ return this.item;
|
||||
+ }
|
||||
@@ -54,13 +54,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return this.ticksHeldFor;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user