mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
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.
This commit is contained in:
parent
5de53af38b
commit
332152c40d
2 changed files with 2 additions and 0 deletions
|
@ -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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue