File tree Expand file tree Collapse file tree 3 files changed +42
-21
lines changed
libraries/resource-loader
resource-loader-client-mca1.2.2-1624-mc12w30e/src/main/java/net/ornithemc/osl/resource/loader/impl
resource-loader-mc1.3-pre-07261249-mc13w07a/src/main/java/net/ornithemc/osl/resource/loader/impl
resource-loader-mc13w09a-mc1.5.2/src/main/java/net/ornithemc/osl/resource/loader/impl Expand file tree Collapse file tree 3 files changed +42
-21
lines changed Original file line number Diff line number Diff line change 1111import net .fabricmc .loader .api .metadata .ModMetadata ;
1212
1313import net .minecraft .client .resource .pack .AbstractTexturePack ;
14+ import net .minecraft .client .resource .pack .TexturePack ;
1415
1516import net .ornithemc .osl .resource .loader .api .ModTexturePack ;
1617
@@ -33,6 +34,10 @@ public InputStream getResource(String location) {
3334 Path path = getPath (location );
3435
3536 if (path == null || !Files .exists (path )) {
37+ if ("/pack.png" .equals (location ) || "/pack.txt" .equals (location )) {
38+ return TexturePack .class .getResourceAsStream (location );
39+ }
40+
3641 return null ;
3742 }
3843
@@ -57,13 +62,15 @@ public ModMetadata getModMetadata() {
5762 }
5863
5964 private Path getPath (String location ) {
60- for (Path root : roots ) {
61- String separator = root .getFileSystem ().getSeparator ();
62- String pathName = location .replace ("/" , separator );
63- Path path = root .resolve (pathName );
64-
65- if (Files .exists (path )) {
66- return path ;
65+ if (!"/pack.png" .equals (location ) && !"/pack.txt" .equals (location )) {
66+ for (Path root : roots ) {
67+ String separator = root .getFileSystem ().getSeparator ();
68+ String pathName = location .replace ("/" , separator );
69+ Path path = root .resolve (pathName );
70+
71+ if (Files .exists (path )) {
72+ return path ;
73+ }
6774 }
6875 }
6976
Original file line number Diff line number Diff line change 1111import net .fabricmc .loader .api .metadata .ModMetadata ;
1212
1313import net .minecraft .client .resource .pack .AbstractTexturePack ;
14+ import net .minecraft .client .resource .pack .TexturePack ;
1415
1516import net .ornithemc .osl .resource .loader .api .ModTexturePack ;
1617
@@ -33,6 +34,10 @@ public InputStream getResource(String location) {
3334 Path path = getPath (location );
3435
3536 if (path == null || !Files .exists (path )) {
37+ if ("/pack.png" .equals (location ) || "/pack.txt" .equals (location )) {
38+ return TexturePack .class .getResourceAsStream (location );
39+ }
40+
3641 return null ;
3742 }
3843
@@ -62,13 +67,15 @@ public ModMetadata getModMetadata() {
6267 }
6368
6469 private Path getPath (String location ) {
65- for (Path root : roots ) {
66- String separator = root .getFileSystem ().getSeparator ();
67- String pathName = location .replace ("/" , separator );
68- Path path = root .resolve (pathName );
69-
70- if (Files .exists (path )) {
71- return path ;
70+ if (!"/pack.png" .equals (location ) && !"/pack.txt" .equals (location )) {
71+ for (Path root : roots ) {
72+ String separator = root .getFileSystem ().getSeparator ();
73+ String pathName = location .replace ("/" , separator );
74+ Path path = root .resolve (pathName );
75+
76+ if (Files .exists (path )) {
77+ return path ;
78+ }
7279 }
7380 }
7481
Original file line number Diff line number Diff line change 1111import net .fabricmc .loader .api .metadata .ModMetadata ;
1212
1313import net .minecraft .client .resource .pack .AbstractTexturePack ;
14+ import net .minecraft .client .resource .pack .TexturePack ;
1415
1516import net .ornithemc .osl .resource .loader .api .ModTexturePack ;
1617
@@ -33,6 +34,10 @@ public InputStream openResource(String location) {
3334 Path path = getPath (location );
3435
3536 if (path == null || !Files .exists (path )) {
37+ if ("/pack.png" .equals (location ) || "/pack.txt" .equals (location )) {
38+ return TexturePack .class .getResourceAsStream (location );
39+ }
40+
3641 return null ;
3742 }
3843
@@ -62,13 +67,15 @@ public ModMetadata getModMetadata() {
6267 }
6368
6469 private Path getPath (String location ) {
65- for (Path root : roots ) {
66- String separator = root .getFileSystem ().getSeparator ();
67- String pathName = location .replace ("/" , separator );
68- Path path = root .resolve (pathName );
69-
70- if (Files .exists (path )) {
71- return path ;
70+ if (!"/pack.png" .equals (location ) && !"/pack.txt" .equals (location )) {
71+ for (Path root : roots ) {
72+ String separator = root .getFileSystem ().getSeparator ();
73+ String pathName = location .replace ("/" , separator );
74+ Path path = root .resolve (pathName );
75+
76+ if (Files .exists (path )) {
77+ return path ;
78+ }
7279 }
7380 }
7481
You can’t perform that action at this time.
0 commit comments