Skip to content

Commit

Permalink
Javadocs improvement as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxplay committed Jul 15, 2024
1 parent b30eda0 commit bdd7810
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions patches/api/0481-Add-CrafterCraftItemEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ event calls.

diff --git a/src/main/java/io/papermc/paper/event/block/CrafterCraftEvent.java b/src/main/java/io/papermc/paper/event/block/CrafterCraftEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..6aec8f56a55c97b13b4e401968f36e301ee021e5
index 0000000000000000000000000000000000000000..40a67f1c9de3fb213dbffd6c7c777b696694f294
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/CrafterCraftEvent.java
@@ -0,0 +1,101 @@
@@ -0,0 +1,105 @@
+package io.papermc.paper.event.block;
+
+import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..6aec8f56a55c97b13b4e401968f36e30
+ }
+
+ /**
+ * Yields the recipe crafted by the crafted.
+ * Yields the recipe crafted by the crafter.
+ *
+ * @return the recipe.
+ */
Expand All @@ -66,7 +66,8 @@ index 0000000000000000000000000000000000000000..6aec8f56a55c97b13b4e401968f36e30
+ * This method may yield a mutated itemstack if other event handlers called {@link #setResult(ItemStack)}.
+ * To retrieve the original result, see {@link #getRecipe()}'s {@link Recipe#getResult()}.
+ *
+ * @return a copy of the result. Modifying said item will not mutate this event or item the crafter crafts.
+ * @return a copy of the result. Modifying said itemstack will not mutate this event or itemstack the
+ * crafter crafts.
+ */
+ @NotNull
+ public ItemStack getResult() {
Expand All @@ -76,6 +77,9 @@ index 0000000000000000000000000000000000000000..6aec8f56a55c97b13b4e401968f36e30
+ /**
+ * Sets the itemstack the crafter crafted.
+ *
+ * The crafter will still consume the itemstacks found inside of it according to the original {@link #getRecipe()}
+ * however, it will dispense the passed itemstack instead of the usual recipes result.
+ *
+ * @param itemStack the itemstack the crafter is crafting.
+ */
+ public void setResult(final @NotNull ItemStack itemStack) {
Expand Down

0 comments on commit bdd7810

Please sign in to comment.