2024-12-14 16:29:32 -05:00
|
|
|
--- a/net/minecraft/stats/ServerRecipeBook.java
|
|
|
|
+++ b/net/minecraft/stats/ServerRecipeBook.java
|
2025-04-12 17:26:44 +02:00
|
|
|
@@ -66,7 +_,7 @@
|
2024-12-14 16:29:32 -05:00
|
|
|
|
|
|
|
for (RecipeHolder<?> recipeHolder : recipes) {
|
|
|
|
ResourceKey<Recipe<?>> resourceKey = recipeHolder.id();
|
|
|
|
- if (!this.known.contains(resourceKey) && !recipeHolder.value().isSpecial()) {
|
2024-12-18 19:09:46 +01:00
|
|
|
+ if (!this.known.contains(resourceKey) && !recipeHolder.value().isSpecial() && org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerRecipeListUpdateEvent(player, resourceKey.location())) { // CraftBukkit
|
2024-12-14 16:29:32 -05:00
|
|
|
this.add(resourceKey);
|
|
|
|
this.addHighlight(resourceKey);
|
|
|
|
this.displayResolver
|
2025-04-12 17:26:44 +02:00
|
|
|
@@ -77,7 +_,7 @@
|
2024-12-14 16:29:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (!list.isEmpty()) {
|
|
|
|
+ if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
|
|
|
|
player.connection.send(new ClientboundRecipeBookAddPacket(list, false));
|
|
|
|
}
|
|
|
|
|
2025-04-12 17:26:44 +02:00
|
|
|
@@ -95,7 +_,7 @@
|
2024-12-14 16:29:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (!list.isEmpty()) {
|
|
|
|
+ if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
|
|
|
|
player.connection.send(new ClientboundRecipeBookRemovePacket(list));
|
|
|
|
}
|
|
|
|
|