Class RecipeManager

java.lang.Object
net.minestom.server.recipe.RecipeManager

public final class RecipeManager extends Object
  • Constructor Details

    • RecipeManager

      public RecipeManager()
  • Method Details

    • addRecipe

      public void addRecipe(@NotNull @NotNull Recipe recipe)
    • addRecipe

      public void addRecipe(@NotNull @NotNull Recipe recipe, @NotNull @NotNull Predicate<Player> predicate)
    • removeRecipe

      public void removeRecipe(@NotNull @NotNull Recipe recipe)
    • getRecipes

      @NotNull public @NotNull Set<Recipe> getRecipes()
    • getRecipeDisplay

      @Nullable public @Nullable RecipeDisplay getRecipeDisplay(int displayId, @Nullable @Nullable Player player)
      Get the recipe display for the specified display id, optionally testing visibility against the given player.
      Parameters:
      displayId - the display id
      player - the player to test visibility against, or null to ignore visibility
      Returns:
      the recipe display, or null if not found or not visible
    • getDeclareRecipesPacket

      @NotNull public @NotNull SendablePacket getDeclareRecipesPacket()
    • createRecipeBookResetPacket

      @NotNull public @NotNull RecipeBookAddPacket createRecipeBookResetPacket(@NotNull @NotNull Player player)
      Creates a RecipeBookAddPacket which replaces the recipe book with the currently unlocked recipes for this player.
      Parameters:
      player - the player to create the packet for
      Returns:
      the recipe book add packet with replace set to true