mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Minor resource pack related fixes (#7884)
This commit is contained in:
1 parent
559b801cc4
commit
95c0aa1e98
5 files changed
+6
-7
No files matched your search
@@ -20,12 +20,12 @@
|
||||
package net.minecraftforge.fmllegacy.packs;
|
||||
|
||||
import net.minecraft.server.packs.AbstractPackResources;
|
||||
import net.minecraft.server.packs.ResourcePackFileNotFoundException;
|
||||
import net.minecraft.server.packs.repository.Pack;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
@@ -66,7 +66,7 @@ public class ModFileResourcePack extends AbstractPackResources
|
||||
{
|
||||
final Path path = modFile.findResource(name);
|
||||
if(!Files.exists(path))
|
||||
throw new ResourcePackFileNotFoundException(modFile.getFilePath().toFile(), name);
|
||||
throw new FileNotFoundException("Can't find resource " + name + " at " + modFile.getFilePath().toString());
|
||||
return Files.newInputStream(path, StandardOpenOption.READ);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ResourcePackLoader {
|
||||
}
|
||||
|
||||
public static List<String> getPackNames() {
|
||||
return ModList.get().applyForEachModFile(mf->"mod:"+mf.getModInfos().get(0).getModId()).collect(Collectors.toList());
|
||||
return ModList.get().applyForEachModFile(mf->"mod:"+mf.getModInfos().get(0).getModId()).filter(n->!n.equals("mod:minecraft")).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static <V> Comparator<Map.Entry<String,V>> getSorter() {
|
||||
|
||||
Reference in new issue
Block a user