mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
@@ -18,7 +18,7 @@ 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.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Called when an item on or used by an entity takes durability damage as a result of being hit/used.
|
||||
@@ -26,6 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * NOTE: default vanilla behaviour dictates that armor/tools picked up by
|
||||
+ * mobs do not take damage (except via Thorns).
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class EntityDamageItemEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
@@ -36,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public EntityDamageItemEvent(@NotNull Entity entity, @NotNull ItemStack item, int damage) {
|
||||
+ public EntityDamageItemEvent(final Entity entity, final ItemStack item, final int damage) {
|
||||
+ super(entity);
|
||||
+ this.item = item;
|
||||
+ this.damage = damage;
|
||||
@@ -47,7 +48,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the item
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ItemStack getItem() {
|
||||
+ return this.item;
|
||||
+ }
|
||||
@@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param damage the damage amount to cause
|
||||
+ */
|
||||
+ public void setDamage(int damage) {
|
||||
+ public void setDamage(final int damage) {
|
||||
+ this.damage = damage;
|
||||
+ }
|
||||
+
|
||||
@@ -76,17 +76,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;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user