PetBehaviorDefaults

public final class PetBehaviorDefaults

The shipped behavior modules on disk: writing one into the pet_behaviors folder, as load asks its writer to, and clearing what an interrupted write left there.

Functions

Link copied to clipboard
public static void removeLeftovers(Path folder, long nowMillis)
Deletes the temporary files write left directly in the folder when a server stopped in the middle of writing a default, once they are a minute old, so one being written now is never touched.
Link copied to clipboard
public static void write(Path folder, String name, Function<String, InputStream> resources)
Writes the shipped behavior module name to folder/name.lua from the resource pet_behaviors/name.