Skip to content

Commit 7c66004

Browse files
committed
Improve texture load
1 parent d1419a0 commit 7c66004

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/kotlin/init/resource/DimOreResourcePack.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ class DimOreResourcePack(location: PackLocationInfo) : AbstractPackResources(loc
7474
&& path.endsWith(".json") -> "items." + path.removePrefix("items/custom.")
7575
path.startsWith("models/item/custom.")
7676
&& path.endsWith(".json") -> "item.model." + path.removePrefix("models/item/custom.")
77-
path.startsWith("textures/") && path.endsWith(".png") -> "texture." + path.removePrefix("textures/")
77+
path.startsWith("textures/") && path.endsWith(".png") -> {
78+
val subPath = path.removePrefix("textures/")
79+
"texture." + subPath.replace('/', '.')
80+
}
7881
path.endsWith(".png") && !path.contains("/") -> "texture.$path"
7982
else -> null
8083
}
@@ -89,8 +92,10 @@ class DimOreResourcePack(location: PackLocationInfo) : AbstractPackResources(loc
8992
fileName.startsWith("items.") && fileName.endsWith(".json") -> "items/custom." + fileName.removePrefix("items.")
9093
fileName.startsWith("item.model.")
9194
&& fileName.endsWith(".json") -> "models/item/custom." + fileName.removePrefix("item.model.")
92-
fileName.startsWith("texture.")
93-
&& fileName.endsWith(".png") -> "textures/" + fileName.removePrefix("texture.")
95+
fileName.startsWith("texture.") && fileName.endsWith(".png") -> {
96+
val subPath = fileName.removePrefix("texture.").removeSuffix(".png")
97+
"textures/" + subPath.replace('.', '/') + ".png"
98+
}
9499
else -> null
95100
}
96101
}

0 commit comments

Comments
 (0)