Search in sources :

Example 1 with FolderPackFinder

use of net.minecraft.resources.FolderPackFinder in project NetherEx by LogicTechCorp.

the class NetherExBiomes method registerBiomePacks.

public static void registerBiomePacks(MinecraftServer server) {
    ResourcePackList<ResourcePackInfo> resourcePacks = server.getResourcePacks();
    ModFile modFile = ModList.get().getModFileById(NetherEx.MOD_ID).getFile();
    if (NetherExConfig.NETHER.biomePackUseGlobalBiomePacks.get()) {
        Path globalBiomePacksPath = FMLPaths.getOrCreateGameRelativePath(FMLPaths.CONFIGDIR.get().resolve(Paths.get("netherex", "biome_packs")), "netherex biome packs");
        resourcePacks.addPackFinder(new FolderPackFinder(globalBiomePacksPath.toFile()));
    }
    if (NetherExConfig.NETHER.biomePackUseDefaultBiomePack.get()) {
        resourcePacks.addPackFinder(new BuiltinDataPack(modFile, "default_nether_biome_pack"));
    }
    if (NetherExConfig.NETHER.biomePackUseNetherExBiomePack.get()) {
        resourcePacks.addPackFinder(new BuiltinDataPack(modFile, "netherex_nether_biome_pack"));
    }
    if (NetherExConfig.NETHER.biomePackUseBOPBiomePack.get()) {
        resourcePacks.addPackFinder(new BuiltinDataPack(modFile, "bop_nether_biome_pack"));
    }
    if (NetherExConfig.NETHER.biomePackUseENBBiomePack.get()) {
        resourcePacks.addPackFinder(new BuiltinDataPack(modFile, "enb_nether_biome_pack"));
    }
    if (NetherExConfig.NETHER.biomePackUseBYGBiomePack.get()) {
        resourcePacks.addPackFinder(new BuiltinDataPack(modFile, "byg_nether_biome_pack"));
    }
}
Also used : Path(java.nio.file.Path) ModFile(net.minecraftforge.fml.loading.moddiscovery.ModFile) BuiltinDataPack(logictechcorp.libraryex.resource.BuiltinDataPack) ResourcePackInfo(net.minecraft.resources.ResourcePackInfo) FolderPackFinder(net.minecraft.resources.FolderPackFinder)

Aggregations

Path (java.nio.file.Path)1 BuiltinDataPack (logictechcorp.libraryex.resource.BuiltinDataPack)1 FolderPackFinder (net.minecraft.resources.FolderPackFinder)1 ResourcePackInfo (net.minecraft.resources.ResourcePackInfo)1 ModFile (net.minecraftforge.fml.loading.moddiscovery.ModFile)1