File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/main/ngtlib-patches/jp/ngt/ngtlib/io Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 4747 }
4848
4949 private static JFileChooser getCustomChooser(String title) {
50+ @@ -231,23 +222,13 @@
51+ return null;
52+ }
53+ }
54+
55+ public static InputStream getInputStream(ResourceLocation par1) throws IOException {
56+ - if (!NGTCore.proxy.isServer()) {
57+ - return NGTUtilClient.getMinecraft().getResourceManager().getResource(par1).getInputStream();
58+ - } else {
59+ - int i = par1.getPath().lastIndexOf("/");
60+ - String s = par1.getPath().substring(i + 1);
61+ - List<File> list = findFile((FileMatcher)((filex) -> filex.getName().equals(s)));
62+ - if (list.isEmpty()) {
63+ - throw new FileNotFoundException("On get stream : " + s);
64+ - } else {
65+ - File file1 = list.get(0);
66+ - return getInputStreamFromFile(file1);
67+ - }
68+ - }
69+ + return NGTCore.proxy.isServer()
70+ + ? com.anatawa12.fixRtm.io.FIXFileLoader.INSTANCE.getInputStream(par1)
71+ + : NGTUtilClient.getMinecraft().getResourceManager().getResource(par1).getInputStream();
72+ }
73+
74+ public static InputStream getInputStreamFromFile(File file) throws IOException {
75+ String s = getArchiveSuffix(file.getAbsolutePath());
76+ return (InputStream)(!s.isEmpty() ? getStreamFromArchive(file, s) : new FileInputStream(file));
You can’t perform that action at this time.
0 commit comments