mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-07 16:01:24 +00:00
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
--- a/net/minecraft/stats/ServerRecipeBook.java
|
|
+++ b/net/minecraft/stats/ServerRecipeBook.java
|
|
@@ -66,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
|
|
@@ -77,7 +_,7 @@
|
|
}
|
|
}
|
|
|
|
- if (!list.isEmpty()) {
|
|
+ if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
|
|
player.connection.send(new ClientboundRecipeBookAddPacket(list, false));
|
|
}
|
|
|
|
@@ -95,7 +_,7 @@
|
|
}
|
|
}
|
|
|
|
- if (!list.isEmpty()) {
|
|
+ if (!list.isEmpty() && player.connection != null) { // SPIGOT-4478 during PlayerLoginEvent
|
|
player.connection.send(new ClientboundRecipeBookRemovePacket(list));
|
|
}
|
|
|