public class ExistingFileHelper
extends java.lang.Object
GatherDataEvent
utilizes the standard
resources (via VanillaPack
), as well as any extra resource packs
passed in via the --existing
argument.Modifier and Type | Field and Description |
---|---|
private SimpleReloadableResourceManager |
clientResources |
private boolean |
enable |
private SimpleReloadableResourceManager |
serverData |
Constructor and Description |
---|
ExistingFileHelper(java.util.Collection<java.nio.file.Path> existingPacks,
boolean enable) |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(ResourceLocation loc,
ResourcePackType type,
java.lang.String pathSuffix,
java.lang.String pathPrefix)
Check if a given resource exists in the known resource packs.
|
private ResourceLocation |
getLocation(ResourceLocation base,
java.lang.String suffix,
java.lang.String prefix) |
private IResourceManager |
getManager(ResourcePackType type) |
IResource |
getResource(ResourceLocation loc,
ResourcePackType type,
java.lang.String pathSuffix,
java.lang.String pathPrefix) |
boolean |
isEnabled() |
private final SimpleReloadableResourceManager clientResources
private final SimpleReloadableResourceManager serverData
private final boolean enable
public ExistingFileHelper(java.util.Collection<java.nio.file.Path> existingPacks, boolean enable)
private IResourceManager getManager(ResourcePackType type)
private ResourceLocation getLocation(ResourceLocation base, java.lang.String suffix, java.lang.String prefix)
public boolean exists(ResourceLocation loc, ResourcePackType type, java.lang.String pathSuffix, java.lang.String pathPrefix)
loc
- the base location of the resource, e.g.
"minecraft:block/stone"
type
- the type of resources to checkpathSuffix
- a string to append after the path, e.g. ".json"
pathPrefix
- a string to append before the path, before a slash, e.g.
"models"
true
if the resource exists in any pack, false
otherwisepublic IResource getResource(ResourceLocation loc, ResourcePackType type, java.lang.String pathSuffix, java.lang.String pathPrefix) throws java.io.IOException
java.io.IOException
public boolean isEnabled()
true
if validation is enabled, false
otherwise