Update patches to latest 1.21.4 #1

Merged
Chaoscaot merged 242 commits from update/1.21.4 into main 2025-04-23 22:27:11 +02:00
2 changed files with 13 additions and 12 deletions
Showing only changes of commit 2d3a1385f1 - Show all commits

View File

@@ -1117,20 +1117,24 @@ public final class Bukkit {
/** /**
* Adds a recipe to the crafting manager. * Adds a recipe to the crafting manager.
* Recipes added with this method won't be sent to the client automatically.
* <p>
* Players still have to discover recipes via {@link Player#discoverRecipe(NamespacedKey)}
* before seeing them in their recipe book.
* *
* @param recipe the recipe to add * @param recipe the recipe to add
* @return true if the recipe was added, false if it wasn't for some * @return true if the recipe was added, false if it wasn't for some reason
* reason * @see #addRecipe(Recipe, boolean)
*/ */
@Contract("null -> false") @Contract("null -> false")
public static boolean addRecipe(@Nullable Recipe recipe) { public static boolean addRecipe(@Nullable Recipe recipe) {
return server.addRecipe(recipe); return server.addRecipe(recipe);
} }
// Paper start - method to send recipes immediately
/** /**
* Adds a recipe to the crafting manager. * Adds a recipe to the crafting manager.
* *
* @apiNote resendRecipes is ignored at the moment for stability reasons, recipes will always be updated
* @param recipe the recipe to add * @param recipe the recipe to add
* @param resendRecipes true to update the client with the full set of recipes * @param resendRecipes true to update the client with the full set of recipes
* @return true if the recipe was added, false if it wasn't for some reason * @return true if the recipe was added, false if it wasn't for some reason
@@ -1139,7 +1143,6 @@ public final class Bukkit {
public static boolean addRecipe(@Nullable Recipe recipe, boolean resendRecipes) { public static boolean addRecipe(@Nullable Recipe recipe, boolean resendRecipes) {
return server.addRecipe(recipe, resendRecipes); return server.addRecipe(recipe, resendRecipes);
} }
// Paper end - method to send recipes immediately
/** /**
* Get a list of all recipes for a given item. The stack size is ignored * Get a list of all recipes for a given item. The stack size is ignored

View File

@@ -988,26 +988,24 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException; public boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException;
/** /**
* Adds a recipe to the crafting manager. Recipes added with * Adds a recipe to the crafting manager.
* this method won't be sent to the client automatically. Use * Recipes added with this method won't be sent to the client automatically.
* {@link #updateRecipes()} or {@link #updateResources()} to
* update clients to new recipes added.
* <p> * <p>
* Player's still have to discover recipes via {@link Player#discoverRecipe(NamespacedKey)} * Players still have to discover recipes via {@link Player#discoverRecipe(NamespacedKey)}
* before seeing them in their recipe book. * before seeing them in their recipe book.
* *
* @param recipe the recipe to add * @param recipe the recipe to add
* @return true if the recipe was added, false if it wasn't for some * @return true if the recipe was added, false if it wasn't for some reason
* reason
* @see #addRecipe(Recipe, boolean) * @see #addRecipe(Recipe, boolean)
*/ */
@Contract("null -> false") @Contract("null -> false")
public boolean addRecipe(@Nullable Recipe recipe); boolean addRecipe(@Nullable Recipe recipe);
// Paper start - method to send recipes immediately // Paper start - method to send recipes immediately
/** /**
* Adds a recipe to the crafting manager. * Adds a recipe to the crafting manager.
* *
* @apiNote resendRecipes is ignored for now for stability reasons, recipes will always be updated
* @param recipe the recipe to add * @param recipe the recipe to add
* @param resendRecipes true to update the client with the full set of recipes * @param resendRecipes true to update the client with the full set of recipes
* @return true if the recipe was added, false if it wasn't for some reason * @return true if the recipe was added, false if it wasn't for some reason