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

This commit is contained in:
Cyborgmas 2020-08-21 13:24:49 -04:00 committed by GitHub
parent c2de232703
commit 797791c2af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -79,7 +79,7 @@ public class ExplodedDirectoryLocator implements IModLocator {
if (Files.exists(found)) return found;
// then try left path (classes)
return mods.get(modFile).getRight().stream().map(p->p.resolve(target)).filter(Files::exists).
findFirst().orElse(found.resolve(target));
findFirst().orElse(found);
}
@Override

View file

@ -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);
}