From 0000000000000000000000000000000000000000 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 64916d17ee81cf2eaec7fbac1cb071db3b3eb258..55f4a6efa7dfb64f131f735f92356d01e7cc775a 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(since = "1.12") public ShapedRecipe(@NotNull ItemStack result) { this(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:'. 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 354af775093fd3a74dac6c64244d8f3464397f72..a9d1f9fc129f757353b879fc5946c4b9299833ea 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(since = "1.12") public ShapelessRecipe(@NotNull ItemStack result) { this(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:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper } /**