From 2d64f8364110264762d04e9e6a1eb841eb3dec0c Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Mon, 15 Jul 2024 16:54:17 +0200 Subject: [PATCH] Important formatting changes --- patches/api/0481-Add-CrafterCraftItemEvent.patch | 6 +++--- ...ItemEvent.patch => 1042-Add-CrafterCraftItemEvent.patch} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename patches/server/{1041-Add-CrafterCraftItemEvent.patch => 1042-Add-CrafterCraftItemEvent.patch} (88%) diff --git a/patches/api/0481-Add-CrafterCraftItemEvent.patch b/patches/api/0481-Add-CrafterCraftItemEvent.patch index b2195552db16c..2a1c75d7e5e01 100644 --- a/patches/api/0481-Add-CrafterCraftItemEvent.patch +++ b/patches/api/0481-Add-CrafterCraftItemEvent.patch @@ -12,7 +12,7 @@ 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..40a67f1c9de3fb213dbffd6c7c777b696694f294 +index 0000000000000000000000000000000000000000..5a7611f0b70012ae2aeac7a6e81e91a9caa40bb2 --- /dev/null +++ b/src/main/java/io/papermc/paper/event/block/CrafterCraftEvent.java @@ -0,0 +1,105 @@ @@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..40a67f1c9de3fb213dbffd6c7c777b69 + + /** + * 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. + * @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..40a67f1c9de3fb213dbffd6c7c777b69 + *

+ * Cancelling this event prevents the crafter from crafting, leaving its inventory untouched. + * -+ * @param cancel true if you wish to cancel this event ++ * @param cancel {@code true} if you wish to cancel this event + */ + @Override + public void setCancelled(final boolean cancel) { diff --git a/patches/server/1041-Add-CrafterCraftItemEvent.patch b/patches/server/1042-Add-CrafterCraftItemEvent.patch similarity index 88% rename from patches/server/1041-Add-CrafterCraftItemEvent.patch rename to patches/server/1042-Add-CrafterCraftItemEvent.patch index a066c0463e172..2bf7730003cb9 100644 --- a/patches/server/1041-Add-CrafterCraftItemEvent.patch +++ b/patches/server/1042-Add-CrafterCraftItemEvent.patch @@ -11,7 +11,7 @@ The patch may be expanded in the future for more crafter related event calls. diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java -index 6c24b25a7c8ce6e34aceb5702f1a0a6732ebca44..e05f69884ace9150a39e9347903e4985435c2203 100644 +index 6c24b25a7c8ce6e34aceb5702f1a0a6732ebca44..1f5621d7f256c225bc410c1cdaecbcea0c5cd9a1 100644 --- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java @@ -166,6 +166,15 @@ public class CrafterBlock extends BaseEntityBlock { @@ -24,7 +24,7 @@ index 6c24b25a7c8ce6e34aceb5702f1a0a6732ebca44..e05f69884ace9150a39e9347903e4985 + ); + if (!event.callEvent()) return; + -+ itemStack = org.bukkit.craftbukkit.inventory.CraftItemStack.unwrap(event.getResult()); ++ itemStack = org.bukkit.craftbukkit.inventory.CraftItemStack.unwrap(event.getResult()); + // Paper end - add CrafterCraftEvent - fire event + crafterBlockEntity.setCraftingTicksRemaining(6);