2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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
2024-08-09 22:05:50 +02:00
index c414ccf03572d48f5c096516fc60a59bb1e8efd7..e9bac744c5b173e6767e2de8480a6697969fdbb0 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
2023-08-06 02:21:59 +02:00
@@ -31,6 +31,7 @@ public class ShapedRecipe extends CraftingRecipe {
@Deprecated
2021-06-11 14:02:28 +02:00
public ShapedRecipe(@NotNull ItemStack result) {
2024-08-09 22:05:50 +02:00
this(NamespacedKey.randomKey(), result);
2023-08-06 02:21:59 +02:00
+ 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
2021-06-11 14:02:28 +02:00
}
2023-08-06 02:21:59 +02:00
/**
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
2024-08-09 22:05:50 +02:00
index b7f46a048633945dc71e8efec9a7ebeed5832fd7..a7513c1aa09b88e3f99e7db40661fd83e682de96 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
2023-08-06 02:21:59 +02:00
@@ -20,6 +20,7 @@ public class ShapelessRecipe extends CraftingRecipe {
@Deprecated
2021-06-11 14:02:28 +02:00
public ShapelessRecipe(@NotNull ItemStack result) {
2024-08-09 22:05:50 +02:00
this(NamespacedKey.randomKey(), result);
2023-08-06 02:21:59 +02:00
+ 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
2021-06-11 14:02:28 +02:00
}
2023-08-06 02:21:59 +02:00
/**