aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0078-Display-warning-on-deprecated-recipe-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0078-Display-warning-on-deprecated-recipe-API.patch')
-rw-r--r--patches/api/0078-Display-warning-on-deprecated-recipe-API.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/api/0078-Display-warning-on-deprecated-recipe-API.patch b/patches/api/0078-Display-warning-on-deprecated-recipe-API.patch
new file mode 100644
index 0000000000..94f1cdd1f2
--- /dev/null
+++ b/patches/api/0078-Display-warning-on-deprecated-recipe-API.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+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 9f9c67e935940833bbfe58e6bfa398e6c86980d5..71e494177473c62449aafda1699b26a0c4c81a68 100644
+--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
++++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+@@ -31,6 +31,7 @@ public class ShapedRecipe extends CraftingRecipe {
+ @Deprecated
+ public ShapedRecipe(@NotNull ItemStack result) {
+ super(NamespacedKey.randomKey(), result);
++ 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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
+ }
+
+ /**
+diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+index 03839302c94adc3175d0a88065cd230257ffd20d..d6e38c7ccfe3b6e85eafb611da20b1a29fb74d97 100644
+--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
++++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+@@ -20,6 +20,7 @@ public class ShapelessRecipe extends CraftingRecipe {
+ @Deprecated
+ public ShapelessRecipe(@NotNull ItemStack result) {
+ super(NamespacedKey.randomKey(), result);
++ 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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
+ }
+
+ /**