// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.builtin.buildertools.prefabeditor.enums;

import javax.annotation.Nonnull;
import com.hypixel.hytale.assetstore.AssetPack;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import com.hypixel.hytale.server.core.prefab.PrefabStore;
import java.util.List;
import java.nio.file.Path;
import java.util.function.Supplier;

public enum PrefabRootDirectory
{
    SERVER(() -> PrefabStore.get().getServerPrefabsPath(), "server.commands.editprefab.ui.rootDirectory.server", false), 
    ASSET(() -> PrefabStore.get().getAssetPrefabsPath(), "server.commands.editprefab.ui.rootDirectory.asset", true), 
    WORLDGEN(() -> PrefabStore.get().getWorldGenPrefabsPath(), "server.commands.editprefab.ui.rootDirectory.worldGen", false), 
    ASSET_ROOT(() -> PrefabStore.get().getAssetRootPath(), "server.commands.editprefab.ui.rootDirectory.assetRoot", false);
    
    private final Supplier<Path> prefabPath;
    private final String localizationString;
    private final boolean supportsMultiPack;
    
    private PrefabRootDirectory(final Supplier<Path> prefabPath, final String localizationString, final boolean supportsMultiPack) {
        this.prefabPath = prefabPath;
        this.localizationString = localizationString;
        this.supportsMultiPack = supportsMultiPack;
    }
    
    public Path getPrefabPath() {
        return this.prefabPath.get();
    }
    
    public String getLocalizationString() {
        return this.localizationString;
    }
    
    public boolean supportsMultiPack() {
        return this.supportsMultiPack;
    }
    
    @Nonnull
    public List<PrefabStore.AssetPackPrefabPath> getAllPrefabPaths() {
        if (this.supportsMultiPack) {
            return PrefabStore.get().getAllAssetPrefabPaths();
        }
        final List<PrefabStore.AssetPackPrefabPath> result = new ObjectArrayList<PrefabStore.AssetPackPrefabPath>(1);
        result.add(new PrefabStore.AssetPackPrefabPath(null, this.getPrefabPath()));
        return result;
    }
}
