Paper/Spigot-Server-Patches/0272-Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch
Aikar b62dfa0bf9
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
39ce5d3a SPIGOT-4399: ItemMeta.equals broken with AttributeModifiers

CraftBukkit Changes:
1cf8b5dc SPIGOT-4400: Populators running on existing chunks
116cb9a1 SPIGOT-4399: Add attribute modifier equality test
5ee1c18a SPIGOT-4398: Set ASM7_EXPERIMENTAL flag
2018-09-28 19:31:59 -04:00

37 lines
1.5 KiB
Diff

From 67fc38f3cdd7827e2bca2f4651cb41f7c35bdb2a 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 b0c726be19..34e34b7855 100644
--- a/src/main/java/net/minecraft/server/RecipeBookServer.java
+++ b/src/main/java/net/minecraft/server/RecipeBookServer.java
@@ -65,6 +65,10 @@ public class RecipeBookServer extends RecipeBook {
NBTTagList nbttaglist = new NBTTagList();
for(MinecraftKey minecraftkey : this.a) {
+ // Paper start - ignore missing recipes
+ IRecipe recipe = this.h.a(minecraftkey);
+ if (recipe == null) continue;
+ // Paper end
nbttaglist.add((NBTBase)(new NBTTagString(minecraftkey.toString())));
}
@@ -72,6 +76,10 @@ public class RecipeBookServer extends RecipeBook {
NBTTagList nbttaglist1 = new NBTTagList();
for(MinecraftKey minecraftkey1 : this.b) {
+ // 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.0