mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 02:10:30 +01:00
dcebe229b5
--- work/Bukkit Submodule work/Bukkit 1627782b..67e91ef7: > Fix some incorrectly handled JavaDoc > SPIGOT-4478: Update PlayerLoginEvent docs > Add API to manipulate boss bar of entities and those created by commands --- work/CraftBukkit Submodule work/CraftBukkit ca22de36..3a911828: > SPIGOT-4477: Arrows only firing direction of boat > SPIGOT-4478: NPE during PlayerLoginEvent recipe manipulation > Add API to manipulate boss bar of entities and those created by commands --- work/Spigot Submodule work/Spigot 2474d93d..947a8e7f: > Rebuild patches
37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
From c45f03541ddd2ec94c13f403ba49db5ef960d275 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sat, 16 Jun 2018 16:23:38 -0400
|
|
Subject: [PATCH] Ignore Missing Recipes in RecipeBook to avoid data errors
|
|
|
|
This code was causing NPE's in saving player data, potentially related to reloads.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/RecipeBookServer.java b/src/main/java/net/minecraft/server/RecipeBookServer.java
|
|
index 1a1619260..c8cdd990e 100644
|
|
--- a/src/main/java/net/minecraft/server/RecipeBookServer.java
|
|
+++ b/src/main/java/net/minecraft/server/RecipeBookServer.java
|
|
@@ -79,6 +79,10 @@ public class RecipeBookServer extends RecipeBook {
|
|
while (iterator.hasNext()) {
|
|
MinecraftKey minecraftkey = (MinecraftKey) iterator.next();
|
|
|
|
+ // Paper start - ignore missing recipes
|
|
+ IRecipe recipe = this.h.a(minecraftkey);
|
|
+ if (recipe == null) continue;
|
|
+ // Paper end
|
|
nbttaglist.add((NBTBase) (new NBTTagString(minecraftkey.toString())));
|
|
}
|
|
|
|
@@ -89,6 +93,10 @@ public class RecipeBookServer extends RecipeBook {
|
|
while (iterator1.hasNext()) {
|
|
MinecraftKey minecraftkey1 = (MinecraftKey) iterator1.next();
|
|
|
|
+ // Paper start - ignore missing recipes
|
|
+ IRecipe recipe = this.h.a(minecraftkey1);
|
|
+ if (recipe == null) continue;
|
|
+ // Paper end
|
|
nbttaglist1.add((NBTBase) (new NBTTagString(minecraftkey1.toString())));
|
|
}
|
|
|
|
--
|
|
2.19.1
|
|
|