Class TravelRules

java.lang.Object
forgottentowns.mod.api.TravelRules

public final class TravelRules extends Object
Shared authored biome travel times for independent trade and recruitment policies.
  • Constructor Details

    • TravelRules

      public TravelRules(ModSettings settings)
      Legacy convenience reader retained for existing compiled packs. New packs should own their setting names and defaults and use TravelRules(int, Map).
      Parameters:
      settings - captured typed settings reader
      Throws:
      IllegalArgumentException - if any duration is outside 1..48 whole days
      NullPointerException - if settings is null
    • TravelRules

      public TravelRules(int fallback, Map<String,Integer> travel)
      Creates travel rules from values chosen entirely by the registering pack.
      Parameters:
      fallback - days for a biome without an explicit override
      travel - authored biome identities mapped to whole travel days
      Throws:
      IllegalArgumentException - if a duration is outside 1..48 or a biome identity is blank
      NullPointerException - if the map or an entry is null
  • Method Details

    • days

      public int days(String biome)
      Resolves an authored journey duration.
      Parameters:
      biome - nonnull exact case-sensitive biome identity
      Returns:
      whole days within 1..48, using the configured default for unknown biomes
      Throws:
      NullPointerException - if biome is null