0
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-07-10 07:39:19 +00:00
Files
Paper/paper-server/patches/sources/net/minecraft/stats/ServerRecipeBook.java.patch
Bjarne Koll a24f9b204c 1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2025-06-17 15:45:25 +02:00

30 lines
1.2 KiB
Diff

--- a/net/minecraft/stats/ServerRecipeBook.java
+++ b/net/minecraft/stats/ServerRecipeBook.java
@@ -63,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
@@ -74,7 +_,7 @@
}
}
- if (!list.isEmpty()) {
+ if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
player.connection.send(new ClientboundRecipeBookAddPacket(list, false));
}
@@ -92,7 +_,7 @@
}
}
- if (!list.isEmpty()) {
+ if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
player.connection.send(new ClientboundRecipeBookRemovePacket(list));
}