PetBehaviorCatalog

public final class PetBehaviorCatalog implements AutoCloseable

The pet behavior modules: every .lua file under the pet_behaviors folder, the shipped defaults among them. A default is written when no file of its name exists anywhere in the folder, so a deleted default comes back and an edited one stays, even after it moves into a subfolder. No default is written by a load that could not read the whole folder, since the part it missed may hold an edited one. A module's id is fmm:pet/ and its file name, and a pet file lists modules by that file name. Each load opens a fresh module owner, so an edited module needs no new revision across reloads.

Properties

Link copied to clipboard
public final static List<String> DEFAULTS
The shipped modules by file name, each a resource under pet_behaviors/ in the jar.
Link copied to clipboard
public final static String ID_PREFIX
Link copied to clipboard
public final static String NAMESPACE

Functions

Link copied to clipboard
public void close()
Link copied to clipboard
public static PetBehaviorCatalog load(Path folder, List<String> defaults, Consumer<String> writeDefault, Consumer<String> warn)
Writes the missing defaults through writeDefault, then loads every module in the folder.
Link copied to clipboard
public Optional<LuaMindModuleDescriptor> module(String name)
The module a pet file names, by its file name.
Link copied to clipboard
public Set<String> names()
The file names of every module that loaded.