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/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch | |
parent | ea00be3aaa1a5727151db9cd82d876613c99e727 (diff) | |
download | Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.tar.gz Paper-ba3c29b92ec29c8c321f7e6160a4a25f65f18088.zip |
Finish converting all events to jspecify annotations
Diffstat (limited to 'patches/api/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch')
-rw-r--r-- | patches/api/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/patches/api/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/api/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch index 4fe75c486c..f0a90f1200 100644 --- a/patches/api/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ b/patches/api/0192-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerRecipeBookClickEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerRecipeBookClickEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..c38ac6d0e0ac4ecbdc73d2bedd7731ff34c9d192 +index 0000000000000000000000000000000000000000..a7becccb2cf3b72744fcac4efa52d7c61e607765 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerRecipeBookClickEvent.java -@@ -0,0 +1,89 @@ +@@ -0,0 +1,87 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.NamespacedKey; @@ -18,22 +18,23 @@ index 0000000000000000000000000000000000000000..c38ac6d0e0ac4ecbdc73d2bedd7731ff +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.jetbrains.annotations.ApiStatus; -+import org.jetbrains.annotations.NotNull; ++import org.jspecify.annotations.NullMarked; + +/** + * Called when a player clicks a recipe in the recipe book + */ ++@NullMarked +public class PlayerRecipeBookClickEvent extends PlayerEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); + -+ @NotNull private NamespacedKey recipe; ++ private NamespacedKey recipe; + private boolean makeAll; + + private boolean cancelled; + + @ApiStatus.Internal -+ public PlayerRecipeBookClickEvent(@NotNull Player player, @NotNull NamespacedKey recipe, boolean makeAll) { ++ public PlayerRecipeBookClickEvent(final Player player, final NamespacedKey recipe, final boolean makeAll) { + super(player); + this.recipe = recipe; + this.makeAll = makeAll; @@ -44,7 +45,6 @@ index 0000000000000000000000000000000000000000..c38ac6d0e0ac4ecbdc73d2bedd7731ff + * + * @return The namespaced key of the recipe + */ -+ @NotNull + public NamespacedKey getRecipe() { + return this.recipe; + } @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..c38ac6d0e0ac4ecbdc73d2bedd7731ff + * + * @param recipe The key of the recipe that should be requested + */ -+ public void setRecipe(@NotNull NamespacedKey recipe) { ++ public void setRecipe(final NamespacedKey recipe) { + this.recipe = recipe; + } + @@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..c38ac6d0e0ac4ecbdc73d2bedd7731ff + * + * @param makeAll {@code true} if the request should attempt to make the maximum amount of results + */ -+ public void setMakeAll(boolean makeAll) { ++ public void setMakeAll(final boolean makeAll) { + this.makeAll = makeAll; + } + @@ -84,17 +84,15 @@ index 0000000000000000000000000000000000000000..c38ac6d0e0ac4ecbdc73d2bedd7731ff + } + + @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; + } |