diff options
author | Jake Potrebic <[email protected]> | 2024-09-29 16:48:34 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-09-29 19:13:41 -0700 |
commit | ba3c29b92ec29c8c321f7e6160a4a25f65f18088 (patch) | |
tree | 822022fb0a406a3c23533578de55ab8bcf5bd3e5 /patches/api/0122-PlayerLaunchProjectileEvent.patch | |
parent | ea00be3aaa1a5727151db9cd82d876613c99e727 (diff) | |
download | Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.tar.gz Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.zip |
Finish converting all events to jspecify annotations
Diffstat (limited to 'patches/api/0122-PlayerLaunchProjectileEvent.patch')
-rw-r--r-- | patches/api/0122-PlayerLaunchProjectileEvent.patch | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/patches/api/0122-PlayerLaunchProjectileEvent.patch b/patches/api/0122-PlayerLaunchProjectileEvent.patch index f284a611d1..9078e566ca 100644 --- a/patches/api/0122-PlayerLaunchProjectileEvent.patch +++ b/patches/api/0122-PlayerLaunchProjectileEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] PlayerLaunchProjectileEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33e29020d7 +index 0000000000000000000000000000000000000000..a6d483e6be8b8527d7cfd676f6056179e8e9bf33 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java -@@ -0,0 +1,95 @@ +@@ -0,0 +1,92 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Player; @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33 +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; -+import org.jetbrains.annotations.NotNull; ++import org.jspecify.annotations.NullMarked; + +/** + * Called when a player shoots a projectile. @@ -29,18 +29,19 @@ index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33 + * of a bow or crossbow. A plugin may listen to {@link EntityShootBowEvent} + * for these actions instead. + */ ++@NullMarked +public class PlayerLaunchProjectileEvent extends PlayerEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); + -+ @NotNull private final Projectile projectile; -+ @NotNull private final ItemStack itemStack; ++ private final Projectile projectile; ++ private final ItemStack itemStack; + private boolean consumeItem = true; + + private boolean cancelled; + + @ApiStatus.Internal -+ public PlayerLaunchProjectileEvent(@NotNull Player shooter, @NotNull ItemStack itemStack, @NotNull Projectile projectile) { ++ public PlayerLaunchProjectileEvent(final Player shooter, final ItemStack itemStack, final Projectile projectile) { + super(shooter); + this.itemStack = itemStack; + this.projectile = projectile; @@ -51,7 +52,6 @@ index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33 + * + * @return the launched projectile + */ -+ @NotNull + public Projectile getProjectile() { + return this.projectile; + } @@ -61,7 +61,6 @@ index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33 + * + * @return The ItemStack used + */ -+ @NotNull + public ItemStack getItemStack() { + return this.itemStack; + } @@ -80,7 +79,7 @@ index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33 + * + * @param consumeItem {@code true} to consume + */ -+ public void setShouldConsume(boolean consumeItem) { ++ public void setShouldConsume(final boolean consumeItem) { + this.consumeItem = consumeItem; + } + @@ -90,17 +89,15 @@ index 0000000000000000000000000000000000000000..efd947eb0aa0633891d9c6a8bde66d33 + } + + @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; + } |