mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
@@ -19,26 +19,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+import org.jspecify.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Fired when a witch consumes the potion in their hand to buff themselves.
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class WitchConsumePotionEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @Nullable private ItemStack potion;
|
||||
+ private @Nullable ItemStack potion;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public WitchConsumePotionEvent(@NotNull Witch witch, @Nullable ItemStack potion) {
|
||||
+ public WitchConsumePotionEvent(final Witch witch, final @Nullable ItemStack potion) {
|
||||
+ super(witch);
|
||||
+ this.potion = potion;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public Witch getEntity() {
|
||||
+ return (Witch) super.getEntity();
|
||||
@@ -47,8 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ /**
|
||||
+ * @return the potion the witch will consume and have the effects applied.
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public ItemStack getPotion() {
|
||||
+ public @Nullable ItemStack getPotion() {
|
||||
+ return this.potion;
|
||||
+ }
|
||||
+
|
||||
@@ -57,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param potion The potion
|
||||
+ */
|
||||
+ public void setPotion(@Nullable ItemStack potion) {
|
||||
+ public void setPotion(final @Nullable ItemStack potion) {
|
||||
+ this.potion = potion != null ? potion.clone() : null;
|
||||
+ }
|
||||
+
|
||||
@@ -70,16 +69,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user