Fix resource pack info generator - use the first modid as part of the

pack prefix.

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw 2019-01-26 16:55:57 -05:00
parent 8b74b32909
commit c578cae676
No known key found for this signature in database
GPG key ID: 8EB3DF749553B1B7

View file

@ -24,6 +24,8 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.loading.FMLLoader;
import net.minecraftforge.fml.loading.moddiscovery.ModFile;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
@ -35,8 +37,11 @@ import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
import static net.minecraftforge.fml.Logging.CORE;
public class ResourcePackLoader
{
private static final Logger LOGGER = LogManager.getLogger();
private static Map<ModFile, ModFileResourcePack> modResourcePacks;
private static ResourcePackList<?> resourcePackList;
@ -69,9 +74,10 @@ public class ResourcePackLoader
{
for (Entry<ModFile, ModFileResourcePack> e : modResourcePacks.entrySet())
{
String name = "modfile/" + e.getKey().getFileName();
final T packInfo = ResourcePackInfo.func_195793_a(name, true, () -> e.getValue(), factory, ResourcePackInfo.Priority.BOTTOM);
final String name = "mod:" + e.getKey().getModInfos().get(0).getModId();
final T packInfo = ResourcePackInfo.func_195793_a(name, true, e::getValue, factory, ResourcePackInfo.Priority.BOTTOM);
e.getValue().setPackInfo(packInfo);
LOGGER.debug(CORE, "Generating PackInfo named {} for mod file {}", name, e.getKey().getFilePath());
packList.put(name, packInfo);
}
}