Class CraftingPlugin

All Implemented Interfaces:
CommandOwner

public class CraftingPlugin extends JavaPlugin
  • Constructor Details

    • CraftingPlugin

      public CraftingPlugin(@Nonnull JavaPluginInit init)
  • Method Details

    • getAvailableRecipesForCategory

      @Nullable public static Set<String> getAvailableRecipesForCategory(@Nonnull String benchId, @Nonnull String benchCategoryId)
    • isValidCraftingMaterialForBench

      public static boolean isValidCraftingMaterialForBench(@Nonnull Bench bench, @Nonnull ItemStack itemStack)
    • isValidUpgradeMaterialForBench

      public static boolean isValidUpgradeMaterialForBench(@Nonnull Bench bench, int tierLevel, @Nonnull ItemStack itemStack)
    • getBenchRecipes

      @Nonnull public static List<CraftingRecipe> getBenchRecipes(@Nonnull Bench bench)
    • getBenchRecipes

      @Nonnull public static List<CraftingRecipe> getBenchRecipes(BenchType benchType, String name)
    • getBenchRecipes

      @Nonnull public static List<CraftingRecipe> getBenchRecipes(BenchType benchType, String benchId, @Nullable String category)
    • learnRecipe

      public static boolean learnRecipe(@Nonnull Ref<EntityStore> ref, @Nonnull String recipeId, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Called to learn the recipe for the given item ID as the given player.
      Parameters:
      ref - The entity reference of the player entity.
      recipeId - The recipe ID that we are attempting to learn.
      componentAccessor - The ComponentAccessor instance for component access.
      Returns:
      true if learning was successful, false otherwise.
    • forgetRecipe

      public static boolean forgetRecipe(@Nonnull Ref<EntityStore> ref, @Nonnull String itemId, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Called to forget a recipe for the given item ID as the given player.
      Parameters:
      ref - The entity reference of the player entity.
      itemId - The item ID that we are attempting to learn.
      componentAccessor - The ComponentAccessor instance for component access.
      Returns:
      true if unlearning the recipe was successful, false otherwise.
    • sendKnownRecipes

      public static void sendKnownRecipes(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Called to send all known recipes to the player.
      Parameters:
      ref - The entity reference of the player entity.
      componentAccessor - The ComponentAccessor instance for component access.
    • getCraftingManagerComponentType

      public ComponentType<EntityStore, CraftingManager> getCraftingManagerComponentType()
    • getBenchBlockComponentType

      public ComponentType<ChunkStore, BenchBlock> getBenchBlockComponentType()
    • getProcessingBenchBlockComponentType

      public ComponentType<ChunkStore, ProcessingBenchBlock> getProcessingBenchBlockComponentType()
    • get

      public static CraftingPlugin get()