public class SetLoader
extends java.lang.Object
SpawnSet
s. It also
acts as storage for the sets that have been loaded.
Created by Hiroku
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SPAWN_SET_FOLDER |
static java.lang.String |
SPAWN_SET_ROOT |
static java.lang.Class<? extends SpawnSet> |
targetedSpawnSetClass
This is the class that the JSON loader will target for spawn sets.
|
Constructor and Description |
---|
SetLoader() |
Modifier and Type | Method and Description |
---|---|
static void |
addSet(SpawnSet set)
Adds the given set to the cache.
|
static void |
checkForMissingSpawnSets()
Checks for any missing
SpawnSets in the default set folder. |
static void |
clearAll()
Clears all sets from the cache.
|
static void |
export(java.lang.String dir,
java.lang.String name)
Exports a set with the given name to the given directory, if possible.
|
static void |
exportAll(java.lang.String dir)
Exports all sets to the given directory.
|
static <T> com.google.common.collect.ImmutableList<T> |
getAllSets()
Gets all the
SpawnSet s. |
static <T> T |
getSet(java.lang.String name)
Gets the set with the given name.
|
static java.lang.String |
getSpawnSetPath()
Gets the current loading directory for
SpawnSet s. |
static java.util.ArrayList<SpawnSet> |
importSetsFrom(java.lang.String dir)
Imports all sets from the given directory.
|
static void |
recursiveSetSearch(java.lang.String dir,
java.util.ArrayList<java.io.File> jsons)
Utility function for doing a recursive search for JSON files.
|
static java.util.ArrayList<SpawnSet> |
retrieveSpawnSetsFromAssets(java.lang.String folder)
|
public static java.lang.Class<? extends SpawnSet> targetedSpawnSetClass
public static final java.lang.String SPAWN_SET_ROOT
public static final java.lang.String DEFAULT_SPAWN_SET_FOLDER
public static <T> com.google.common.collect.ImmutableList<T> getAllSets()
SpawnSet
s. Parameterizing will cause an attempt to cast all sets to that type.public static void clearAll()
public static <T> T getSet(java.lang.String name)
public static void export(java.lang.String dir, java.lang.String name)
public static void exportAll(java.lang.String dir)
public static java.util.ArrayList<SpawnSet> importSetsFrom(java.lang.String dir)
SpawnInfoPokemon
, it will discard any that do not fit the
configured available generations as defined by the PixelmonConfig
.public static void recursiveSetSearch(java.lang.String dir, java.util.ArrayList<java.io.File> jsons)
public static void addSet(SpawnSet set)
public static java.lang.String getSpawnSetPath()
SpawnSet
s.public static void checkForMissingSpawnSets()
SpawnSets
in the default set folder.public static java.util.ArrayList<SpawnSet> retrieveSpawnSetsFromAssets(java.lang.String folder)
SpawnSet
s from the jar, and if external spawning JSONs are on,
and the file found in the assets does not exist in the default SpawnSet
folder,
copies it out into that location. This does not regenerate modified files, only removed ones.
If external spawning JSONs are not on, the sets are added into the cache as per usual.