13
0
geforkt von Mirrors/Paper
Paper/paper-server/patches/sources/net/minecraft/stats/ServerRecipeBook.java.patch

30 Zeilen
1.2 KiB
Diff

2024-12-14 22:29:32 +01:00
--- 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));
}