Finish converting all events to jspecify annotations

This commit is contained in:
Jake Potrebic
2024-09-29 16:48:34 -07:00
parent fa97c59a4e
commit 29a25df60e
78 changed files with 757 additions and 883 deletions

View File

@@ -20,25 +20,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Fired when a player boosts elytra flight with a firework
+ */
+@NullMarked
+public class PlayerElytraBoostEvent extends PlayerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull private final ItemStack itemStack;
+ @NotNull private final Firework firework;
+ private final ItemStack itemStack;
+ private final Firework firework;
+ private boolean consume = true;
+ @NotNull
+ private final EquipmentSlot hand;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerElytraBoostEvent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull Firework firework, @NotNull EquipmentSlot hand) {
+ public PlayerElytraBoostEvent(final Player player, final ItemStack itemStack, final Firework firework, final EquipmentSlot hand) {
+ super(player);
+ this.itemStack = itemStack;
+ this.firework = firework;
@@ -50,7 +50,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return ItemStack of firework
+ */
+ @NotNull
+ public ItemStack getItemStack() {
+ return this.itemStack;
+ }
@@ -60,7 +59,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return Firework entity
+ */
+ @NotNull
+ public Firework getFirework() {
+ return this.firework;
+ }
@@ -79,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @param consume {@code true} to consume
+ */
+ public void setShouldConsume(boolean consume) {
+ public void setShouldConsume(final boolean consume) {
+ this.consume = consume;
+ }
+
@@ -88,7 +86,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return interaction hand
+ */
+ @NotNull
+ public EquipmentSlot getHand() {
+ return this.hand;
+ }
@@ -99,17 +96,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @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;
+ }