2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/stats/RecipeBookServer.java
|
|
|
|
+++ b/net/minecraft/stats/RecipeBookServer.java
|
|
|
|
@@ -20,6 +20,8 @@
|
2018-09-30 01:24:51 +02:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
|
2021-03-08 22:47:33 +01:00
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
2018-09-30 01:24:51 +02:00
|
|
|
public class RecipeBookServer extends RecipeBook {
|
|
|
|
|
2021-03-08 22:47:33 +01:00
|
|
|
private static final Logger LOGGER = LogManager.getLogger();
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -35,7 +37,7 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
IRecipe<?> irecipe = (IRecipe) iterator.next();
|
2018-09-30 01:24:51 +02:00
|
|
|
MinecraftKey minecraftkey = irecipe.getKey();
|
|
|
|
|
2020-08-11 23:00:00 +02:00
|
|
|
- if (!this.recipes.contains(minecraftkey) && !irecipe.isComplex()) {
|
|
|
|
+ if (!this.recipes.contains(minecraftkey) && !irecipe.isComplex() && CraftEventFactory.handlePlayerRecipeListUpdateEvent(entityplayer, minecraftkey)) { // CraftBukkit
|
2018-09-30 01:24:51 +02:00
|
|
|
this.a(minecraftkey);
|
2019-12-10 23:00:00 +01:00
|
|
|
this.d(minecraftkey);
|
2018-12-25 22:00:00 +01:00
|
|
|
list.add(minecraftkey);
|
2021-03-15 23:00:00 +01:00
|
|
|
@@ -69,6 +71,7 @@
|
2018-11-10 10:30:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void a(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List<MinecraftKey> list) {
|
|
|
|
+ if (entityplayer.playerConnection == null) return; // SPIGOT-4478 during PlayerLoginEvent
|
2020-08-11 23:00:00 +02:00
|
|
|
entityplayer.playerConnection.sendPacket(new PacketPlayOutRecipes(packetplayoutrecipes_action, list, Collections.emptyList(), this.a()));
|
2018-11-10 10:30:58 +01:00
|
|
|
}
|
|
|
|
|