aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/stats/ServerRecipeBook.java.patch
blob: 8ffb0784bebdc1064aaea5800d34cda82bdf4929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- a/net/minecraft/stats/ServerRecipeBook.java
+++ b/net/minecraft/stats/ServerRecipeBook.java
@@ -20,6 +20,8 @@
 import net.minecraft.world.item.crafting.RecipeManager;
 import org.slf4j.Logger;
 
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
 public class ServerRecipeBook extends RecipeBook {
 
     public static final String RECIPE_BOOK_TAG = "recipeBook";
@@ -36,11 +38,11 @@
             RecipeHolder<?> recipeholder = (RecipeHolder) iterator.next();
             ResourceLocation resourcelocation = recipeholder.id();
 
-            if (!this.known.contains(resourcelocation) && !recipeholder.value().isSpecial()) {
-                this.add(resourcelocation);
-                this.addHighlight(resourcelocation);
-                list.add(resourcelocation);
-                CriteriaTriggers.RECIPE_UNLOCKED.trigger(serverplayer, recipeholder);
+            if (!this.known.contains(minecraftkey) && !recipeholder.value().isSpecial() && CraftEventFactory.handlePlayerRecipeListUpdateEvent(player, minecraftkey)) { // CraftBukkit
+                this.add(minecraftkey);
+                this.addHighlight(minecraftkey);
+                list.add(minecraftkey);
+                CriteriaTriggers.RECIPE_UNLOCKED.trigger(player, recipeholder);
                 ++i;
             }
         }