Advanced Configuration Techniques - MisterWonderful/DivineHordes GitHub Wiki

🚀 Advanced Configuration Techniques

1. Difficulty Curve Customization

# Create custom difficulty progression
difficulty:
  # Gentle early game
  min-multiplier: 0.8
  base-multiplier: 1.0
  
  # Aggressive late game scaling
  player-scaling:
    scaling-per-player: 0.25
  time-scaling:
    scaling-per-minute: 0.08
    max-multiplier: 2.5

2. Server-Specific Offering Pools

# Survival server focus
offerings:
  items:
    common:
      - "IRON_BLOCK:3-5"      # Building materials
      - "DIAMOND:2-4"         # Tool materials
    rare:
      - "SHULKER_SHELL:1"     # Storage upgrades
      - "ELYTRA:1"            # Transportation

# PvP server focus
offerings:
  items:
    common:
      - "DIAMOND:5-8"         # Weapon materials
      - "ENCHANTED_BOOK:1-2"  # Combat enchants
    rare:
      - "TOTEM_OF_UNDYING:1"  # Combat items
      - "GOLDEN_APPLE:3-5"    # PvP consumables

3. Event Timing Strategies

# Peak hours - more frequent events
events:
  interval:
    min: 5
    max: 10

# Off-peak hours - longer breaks
events:
  interval:
    min: 15
    max: 25

🔧 ConfigUtils.java Integration

The configuration system is powered by the ConfigUtils.java class, which provides:

🎯 Key Features:

  • Type-Safe Access: Methods return correct data types with fallbacks
  • Performance Caching: Frequently accessed values are cached
  • Change Detection: Automatically detects when config file changes
  • Validation Logic: Built-in validation for all configuration sections

📝 Example Usage in Code:

// Get configuration values with automatic fallbacks
int baseMobCount = plugin.getConfigUtils().getBaseMobCount();
boolean isDifficultyEnabled = plugin.getConfigUtils().isDynamicDifficultyEnabled();
double healthMultiplier = plugin.getConfigUtils().getHealthMultiplier();

// Values are automatically validated and have safe defaults
// No need to check for null or invalid values in game logic