mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-24 06:04:27 +00:00
1 parent
0dfffca88e
commit
ffc324bab6
38 files changed
+1920
-166
No files matched your search
@@ -43,6 +43,7 @@ public class TexturePackAPI {
|
||||
public static final String DEFAULT_NAMESPACE = "minecraft";
|
||||
|
||||
public static final String MCPATCHER_SUBDIR = "mcpatcher/";
|
||||
public static final String OPTIFINE_SUBDIR = "optifine/";
|
||||
public static final ResourceLocation ITEMS_PNG = new ResourceLocation("textures/atlas/items.png");
|
||||
|
||||
private static final String ASSETS = "assets/";
|
||||
@@ -204,6 +205,11 @@ public class TexturePackAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String subdirOf(ResourceLocation baseResource) {
|
||||
return baseResource != null && baseResource.getResourcePath()
|
||||
.startsWith(OPTIFINE_SUBDIR) ? OPTIFINE_SUBDIR : MCPATCHER_SUBDIR;
|
||||
}
|
||||
|
||||
public static ResourceLocation parseResourceLocation(ResourceLocation baseResource, String path) {
|
||||
if (MCPatcherUtils.isNullOrEmpty(path)) {
|
||||
return null;
|
||||
@@ -232,8 +238,8 @@ public class TexturePackAPI {
|
||||
ResourceLocation resource;
|
||||
if (path.startsWith("~/")) {
|
||||
// Relative to namespace mcpatcher dir:
|
||||
// ~/path -> assets/(namespace of base file)/mcpatcher/path
|
||||
resource = new ResourceLocation(baseResource.getResourceDomain(), MCPATCHER_SUBDIR + path.substring(2));
|
||||
// ~/path -> assets/(namespace of base file)/(mcpatcher|optifine)/path
|
||||
resource = new ResourceLocation(baseResource.getResourceDomain(), subdirOf(baseResource) + path.substring(2));
|
||||
} else if (path.startsWith("./")) {
|
||||
// Relative to properties file:
|
||||
// ./path -> (dir of base file)/path
|
||||
|
||||
Reference in new issue
Block a user