--- a/net/minecraft/stats/ServerRecipeBook.java
+++ b/net/minecraft/stats/ServerRecipeBook.java
@@ -67,7 +_,7 @@
 
         for (RecipeHolder<?> recipeHolder : recipes) {
             ResourceKey<Recipe<?>> resourceKey = recipeHolder.id();
-            if (!this.known.contains(resourceKey) && !recipeHolder.value().isSpecial()) {
+            if (!this.known.contains(resourceKey) && !recipeHolder.value().isSpecial() && org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerRecipeListUpdateEvent(player, resourceKey.location())) { // CraftBukkit
                 this.add(resourceKey);
                 this.addHighlight(resourceKey);
                 this.displayResolver
@@ -78,7 +_,7 @@
             }
         }
 
-        if (!list.isEmpty()) {
+        if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
             player.connection.send(new ClientboundRecipeBookAddPacket(list, false));
         }
 
@@ -96,7 +_,7 @@
             }
         }
 
-        if (!list.isEmpty()) {
+        if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
             player.connection.send(new ClientboundRecipeBookRemovePacket(list));
         }
 
