0
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-07-28 11:00:31 +00:00
Files
Paper/paper-server/patches/sources/net/minecraft/stats/ServerRecipeBook.java.patch

30 lines
1.2 KiB
Diff
Raw Permalink Normal View History

2024-12-14 16:29:32 -05:00
--- a/net/minecraft/stats/ServerRecipeBook.java
+++ b/net/minecraft/stats/ServerRecipeBook.java
@@ -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
@@ -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));
}
@@ -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));
}