mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 09:21:57 +01:00
29 lines
1.2 KiB
Diff
29 lines
1.2 KiB
Diff
--- 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));
|
|
}
|
|
|