Fix small logging issues with loading pack.png for mods (#7265)
This commit is contained in:
parent
c2de232703
commit
797791c2af
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue