mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Introduce custom loader additions to the model data generators. (#7450)
Currently implemented loaders: * OBJ * Composite * Multi-layer * Item layers (vanilla item/generated but with fullbright texture support) * Bucket * Separate Perspective
This commit is contained in:
1 parent
cf3e9d1e0c
commit
fed7beab89
18 files changed
+660
-20
No files matched your search
@@ -70,6 +70,22 @@ public class ExistingFileHelper {
|
||||
return new ResourceLocation(base.getNamespace(), prefix + "/" + base.getPath() + suffix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given resource exists in the known resource packs.
|
||||
*
|
||||
* @param loc the base location of the resource, e.g.
|
||||
* {@code "minecraft:block/stone"}
|
||||
* @param type the type of resources to check
|
||||
* @return {@code true} if the resource exists in any pack, {@code false}
|
||||
* otherwise
|
||||
*/
|
||||
public boolean exists(ResourceLocation loc, ResourcePackType type) {
|
||||
if (!enable) {
|
||||
return true;
|
||||
}
|
||||
return getManager(type).hasResource(loc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given resource exists in the known resource packs.
|
||||
*
|
||||
@@ -83,15 +99,17 @@ public class ExistingFileHelper {
|
||||
* otherwise
|
||||
*/
|
||||
public boolean exists(ResourceLocation loc, ResourcePackType type, String pathSuffix, String pathPrefix) {
|
||||
if (!enable) {
|
||||
return true;
|
||||
}
|
||||
return getManager(type).hasResource(getLocation(loc, pathSuffix, pathPrefix));
|
||||
return exists(getLocation(loc, pathSuffix, pathPrefix), type);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public IResource getResource(ResourceLocation loc, ResourcePackType type, String pathSuffix, String pathPrefix) throws IOException {
|
||||
return getManager(type).getResource(getLocation(loc, pathSuffix, pathPrefix));
|
||||
return getResource(getLocation(loc, pathSuffix, pathPrefix), type);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public IResource getResource(ResourceLocation loc, ResourcePackType type) throws IOException {
|
||||
return getManager(type).getResource(loc);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user