Skip to content

3.0.0

Choose a tag to compare

@Traqueur-dev Traqueur-dev released this 01 Oct 19:58
· 6 commits to main since this release
68445e9

Changelog - RecipesAPI v3.0.0

Major Features

  • RecipeLoader System: Added new RecipeLoader class for flexible recipe loading with fluent API
    • Load recipes from multiple folders recursively with addFolder()
    • Load individual recipe files with addFile()
    • Automatic extraction of default recipes from plugin JAR when folders don't exist
    • Runtime recipe reloading with reload() method
    • Access via recipesAPI.createLoader()
  • Comprehensive YAML Support: Full documentation and validation for YAML recipe configuration
    • Pattern validation for shaped recipes (max 3x3, validates ingredient signs)
    • Support for all vanilla recipe types (smelting, blasting, smoking, campfire, stonecutting, smithing)
    • Recipe categories and groups for recipe book organization

Breaking Changes

  • Automatic Recipe Loading Removed: Recipes are no longer automatically loaded from recipes/ folder on initialization
    • Users must now explicitly use RecipeLoader to load YAML recipes
    • Constructor no longer accepts enableYmlSupport parameter
  • Base64 Class Removed: Custom Base64 utility class deleted - now uses Java's built-in Base64.getDecoder()

Bug Fixes

  • Shaped Recipe Validation: Fixed critical crafting grid validation to properly handle empty spaces and air blocks in patterns
  • Shapeless Recipe Matching: Improved ingredient validation to correctly count items and prevent false positives
  • ItemStack Ingredient Comparison: Fixed metadata checking logic - now correctly validates that ingredient requirements are present in source item (previously checked backwards)
  • Null Safety: Added null checks for ItemStack comparison in ItemStackIngredient.isSimilar()
  • Typo Fix: Corrected "withou" to "without" in error message

Improvements

  • Enhanced Pattern Validation: Added comprehensive validation for shaped recipe patterns
    • Validates pattern dimensions (max 3 rows, max 3 characters per row)
    • Ensures all pattern characters have corresponding ingredients
    • Prevents empty pattern rows
  • Better Error Messages: More descriptive debug messages for shaped recipe validation
    • Reports specific position of mismatches
    • Distinguishes between missing ingredients, wrong items, and air block issues
  • Metadata Handling: Refined metadata comparison to only check properties that exist in ingredient definition
    • Lore checked only if ingredient has lore
    • Custom model data checked only if ingredient has custom model data
    • PDC keys validated from ingredient to source (not bidirectional)
  • YAML Ingredient Types: Expanded support for ingredient formats
    • Material references: material:NAME
    • Minecraft tags: tag:NAME
    • Base64 encoded items: item:BASE64 or base64:BASE64
    • Plugin items: itemsadder:ID, oraxen:ID
    • Strict matching mode with strict: true

Dependency Updates

  • ItemsAdder: Updated from com.github.LoneDev6:API-ItemsAdder:3.6.1 to dev.lone:api-itemsadder:4.0.10
  • Maven Repository: Changed from JitPack to maven.devs.beer
  • Resource File: Renamed version.properties back to recipeapi.properties

Documentation

  • Expanded README: Added extensive documentation including:
    • Recipe loader usage examples with folder and file loading
    • Complete YAML configuration reference with examples
    • Plugin hooks documentation (ItemsAdder, Oraxen, custom hooks)
    • Custom ingredient types and strict mode explanation
    • Pattern validation rules
    • All supported recipe types
  • API Usage: Clarified constructor parameters and added RecipeLoader creation method
  • Code Examples: Updated with numbered recipe examples and improved comments

Internal Improvements

  • Recipe Validation: Strengthened shaped recipe pattern-to-ingredient matching
  • Category Validation: Improved checkCategory() method with explicit enum checking
  • Error Handling: Better exception messages for Base64 decoding failures and configuration errors

Migration Guide (v2.0.2 → v3.0.0):

  • Replace automatic recipe loading with explicit RecipeLoader:
    // Old (v2.0.2) - automatic loading
    recipesAPI = new RecipesAPI(this, true);
    
    // New (v3.0.0) - manual loading
    recipesAPI = new RecipesAPI(this, true);
    RecipeLoader loader = recipesAPI.createLoader()
        .addFolder("recipes/")
        .load();

Full Changelog: 2.0.3...3.0.0