From ece3333123a97990408be5392361e288b63835ba Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 9 Dec 2017 12:42:11 -0500 Subject: [PATCH] Display warning on deprecated recipe API Any plugin still using this API will result in the server saving an inconsistent UUID to player data files, which then triggers warnings such as "Tried to load unrecognized recipe: bukkit:9e5b92f5-e549-4f47-b0a8-9f89390ed77b removed now." on the players login. Plugin authors need to define a key to keep it consistent between server restarts. --- ...lay-warning-on-deprecated-recipe-API.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch diff --git a/Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch b/Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch new file mode 100644 index 0000000000..03573142d4 --- /dev/null +++ b/Spigot-API-Patches/0075-Display-warning-on-deprecated-recipe-API.patch @@ -0,0 +1,38 @@ +From 71b19d58c49cc29951d7a0b7b2cba4ae2bb603c8 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 9 Dec 2017 12:40:25 -0500 +Subject: [PATCH] Display warning on deprecated recipe API + +Any plugin still using this API will result in the server saving an inconsistent UUID to player data files, +which then triggers warnings such as "Tried to load unrecognized recipe: bukkit:9e5b92f5-e549-4f47-b0a8-9f89390ed77b removed now." +on the players login. + +Plugin authors need to define a key to keep it consistent between server restarts. + +diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java +index d9af7155..d7fa6d28 100644 +--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java ++++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java +@@ -23,6 +23,7 @@ public class ShapedRecipe implements Recipe, Keyed { + @Deprecated + public ShapedRecipe(ItemStack result) { + this.key = NamespacedKey.randomKey(); ++ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); + this.output = new ItemStack(result); + } + +diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +index ca5c09b8..f2dd46f2 100644 +--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java ++++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +@@ -23,6 +23,7 @@ public class ShapelessRecipe implements Recipe, Keyed { + @Deprecated + public ShapelessRecipe(ItemStack result) { + this.key = NamespacedKey.randomKey(); ++ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); + this.output = new ItemStack(result); + } + +-- +2.15.1 +