Fix small logging issues with loading pack.png for mods (#7265)

This commit is contained in:
Cyborgmas authored and GitHub committed 2020-08-21 10:24:49 -07:00
1 parent c2de232703
commit 797791c2af
2 files changed
+4 -1

No files matched your search

@@ -19,6 +19,7 @@
package net.minecraftforge.fml.packs;
import net.minecraft.resources.ResourcePackFileNotFoundException;
import net.minecraft.resources.ResourcePackInfo;
import net.minecraft.resources.ResourcePackType;
import net.minecraft.util.ResourceLocation;
@@ -63,6 +64,8 @@ public class ModFileResourcePack extends DelegatableResourcePack
public InputStream getInputStream(String name) throws IOException
{
final Path path = modFile.getLocator().findPath(modFile, name);
if(!Files.exists(path))
throw new ResourcePackFileNotFoundException(path.toFile(), name);
return Files.newInputStream(path, StandardOpenOption.READ);
}