Package forgottentowns.mod.api
Class TravelRules
java.lang.Object
forgottentowns.mod.api.TravelRules
Shared authored biome travel times for independent trade and recruitment policies.
-
Constructor Summary
ConstructorsConstructorDescriptionTravelRules(int fallback, Map<String, Integer> travel) Creates travel rules from values chosen entirely by the registering pack.TravelRules(ModSettings settings) Legacy convenience reader retained for existing compiled packs. -
Method Summary
-
Constructor Details
-
TravelRules
Legacy convenience reader retained for existing compiled packs. New packs should own their setting names and defaults and useTravelRules(int, Map).- Parameters:
settings- captured typed settings reader- Throws:
IllegalArgumentException- if any duration is outside 1..48 whole daysNullPointerException- if settings is null
-
TravelRules
Creates travel rules from values chosen entirely by the registering pack.- Parameters:
fallback- days for a biome without an explicit overridetravel- authored biome identities mapped to whole travel days- Throws:
IllegalArgumentException- if a duration is outside 1..48 or a biome identity is blankNullPointerException- if the map or an entry is null
-
-
Method Details
-
days
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
-