// Path: src/main/java/com/oitsjustjose/geolosys/common/world/PlutonRegistry.java
// public class PlutonRegistry {
//     private ArrayList<IDeposit> deposits;
// 
//     public PlutonRegistry() {
//         this.deposits = new ArrayList<>();
//     }
// 
//     public void clear() {
//         this.deposits = new ArrayList<>();
//     }
// 
//     @SuppressWarnings("unchecked")
//     public ArrayList<IDeposit> getOres() {
//         return (ArrayList<IDeposit>) this.deposits.clone();
//     }
// 
//     public boolean addDeposit(IDeposit ore) {
//         return this.deposits.add(ore);
//     }
// 
//     @Nullable
//     public IDeposit pick(ISeedReader reader, BlockPos pos, Random rand) {
//         @SuppressWarnings("unchecked")
//         ArrayList<IDeposit> choices = (ArrayList<IDeposit>) this.deposits.clone();
//         // Dimension Filtering done here!
//         choices.removeIf((dep) -> {
//             ResourceLocation dim = reader.getWorld().getDimensionKey().getLocation();
//             boolean isDimFilterBl = dep.isDimensionFilterBl();
//             for (String dim2Raw : dep.getDimensionFilter()) {
//                 boolean match = new ResourceLocation(dim2Raw).equals(dim);
//                 if ((isDimFilterBl && match) || (!isDimFilterBl && !match)) {
//                     return true;
//                 }
//             }
//             return false;
//         });
// 
//         if (choices.size() == 0) {
//             return null;
//         }
// 
//         /* 1/3 chance to lean towards a biome restricted deposit */
//         if (rand.nextInt(3) == 0) {
//             // Only remove the entries if there's at least one.
//             if (choices.stream().anyMatch((dep) -> {
//                 return dep.hasBiomeRestrictions() && dep.canPlaceInBiome(reader.getBiome(pos));
//             })) {
//                 choices.removeIf((dep) -> {
//                     return !(dep.hasBiomeRestrictions() && dep.canPlaceInBiome(reader.getBiome(pos)));
//                 });
//             }
//         }
// 
//         int totalWt = 0;
//         for (IDeposit d : choices) {
//             totalWt += d.getGenWt();
//         }
// 
//         int rng = rand.nextInt(totalWt);
//         for (IDeposit d : choices) {
//             int wt = d.getGenWt();
//             if (rng < wt) {
//                 return d;
//             }
//             rng -= wt;
//         }
// 
//         Geolosys.getInstance().LOGGER.error("Could not reach decision on pluton to generate at PlutonRegistry#pick");
//         return null;
//     }
// 
//     // Collects UNDERGROUND_ORES & UNDERGROUND_DECORATION to make it easier to
//     // iterate
//     private static final List<GenerationStage.Decoration> decorations = new LinkedList<>();
//     static {
//         decorations.add(GenerationStage.Decoration.UNDERGROUND_ORES);
//         decorations.add(GenerationStage.Decoration.UNDERGROUND_DECORATION);
//     }
// 
//     @SubscribeEvent
//     public void onBiomesLoaded(BiomeLoadingEvent evt) {
//         BiomeGenerationSettingsBuilder settings = evt.getGeneration();
// 
//         // Removes vanilla ores
//         if (CommonConfig.REMOVE_VANILLA_ORES.get()) {
//             for (GenerationStage.Decoration deco : decorations) {
//                 FeatureUtils.destroyFeature(settings.getFeatures(deco),
//                         OreRemover.filterFeatures(settings.getFeatures(deco)));
//             }
//         }
// 
//         DepositFeature o = new DepositFeature(NoFeatureConfig.CODEC);
// 
//         settings.withFeature(GenerationStage.Decoration.UNDERGROUND_ORES,
//                 o.withConfiguration(NoFeatureConfig.NO_FEATURE_CONFIG));
//     }
// }
// 
// Path: src/main/java/com/oitsjustjose/geolosys/common/world/capability/IDepositCapability.java
// public interface IDepositCapability extends INBTSerializable<CompoundNBT> {
//     boolean hasPlutonGenerated(ChunkPos pos);
// 
//     void setPlutonGenerated(ChunkPos pos);
// 
//     void putPendingBlock(BlockPos pos, BlockState state);
// 
//     BlockState getPendingBlock(BlockPos pos);
// 
//     ConcurrentLinkedQueue<ChunkPos> getGenMap();
// 
//     Map<BlockPos, BlockState> getPendingBlocks();
// 
//     boolean hasPlayerReceivedManual(UUID uuid);
// 
//     void setPlayerReceivedManual(UUID uuid);
// 
//     Map<UUID, Boolean> getGivenMap();
// }


import com.oitsjustjose.geolosys.common.world.PlutonRegistry;
import com.oitsjustjose.geolosys.common.world.capability.IDepositCapability;
import net.minecraft.block.BlockState;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import java.util.ArrayList;
package com.oitsjustjose.geolosys.api;



/**
 * The Geolosys API is intended for use by anyone who wants to tap into all the
 * locations that deposits exist Access is pretty easy, just reference this
 * class's currentWorldDeposits HashMap
 */
public class GeolosysAPI {
    @CapabilityInject(IDepositCapability.class)
    public static final Capability<IDepositCapability> GEOLOSYS_WORLD_CAPABILITY = null;
    // A collection of blocks to ignore in the OreConverter feature
    public static ArrayList<BlockState> oreConverterBlacklist = new ArrayList<>();
    // An instance of the registry for all generatable plutons
// Path: src/main/java/com/oitsjustjose/geolosys/common/world/PlutonRegistry.java
// public class PlutonRegistry {
//     private ArrayList<IDeposit> deposits;
// 
//     public PlutonRegistry() {
//         this.deposits = new ArrayList<>();
//     }
// 
//     public void clear() {
//         this.deposits = new ArrayList<>();
//     }
// 
//     @SuppressWarnings("unchecked")
//     public ArrayList<IDeposit> getOres() {
//         return (ArrayList<IDeposit>) this.deposits.clone();
//     }
// 
//     public boolean addDeposit(IDeposit ore) {
//         return this.deposits.add(ore);
//     }
// 
//     @Nullable
//     public IDeposit pick(ISeedReader reader, BlockPos pos, Random rand) {
//         @SuppressWarnings("unchecked")
//         ArrayList<IDeposit> choices = (ArrayList<IDeposit>) this.deposits.clone();
//         // Dimension Filtering done here!
//         choices.removeIf((dep) -> {
//             ResourceLocation dim = reader.getWorld().getDimensionKey().getLocation();
//             boolean isDimFilterBl = dep.isDimensionFilterBl();
//             for (String dim2Raw : dep.getDimensionFilter()) {
//                 boolean match = new ResourceLocation(dim2Raw).equals(dim);
//                 if ((isDimFilterBl && match) || (!isDimFilterBl && !match)) {
//                     return true;
//                 }
//             }
//             return false;
//         });
// 
//         if (choices.size() == 0) {
//             return null;
//         }
// 
//         /* 1/3 chance to lean towards a biome restricted deposit */
//         if (rand.nextInt(3) == 0) {
//             // Only remove the entries if there's at least one.
//             if (choices.stream().anyMatch((dep) -> {
//                 return dep.hasBiomeRestrictions() && dep.canPlaceInBiome(reader.getBiome(pos));
//             })) {
//                 choices.removeIf((dep) -> {
//                     return !(dep.hasBiomeRestrictions() && dep.canPlaceInBiome(reader.getBiome(pos)));
//                 });
//             }
//         }
// 
//         int totalWt = 0;
//         for (IDeposit d : choices) {
//             totalWt += d.getGenWt();
//         }
// 
//         int rng = rand.nextInt(totalWt);
//         for (IDeposit d : choices) {
//             int wt = d.getGenWt();
//             if (rng < wt) {
//                 return d;
//             }
//             rng -= wt;
//         }
// 
//         Geolosys.getInstance().LOGGER.error("Could not reach decision on pluton to generate at PlutonRegistry#pick");
//         return null;
//     }
// 
//     // Collects UNDERGROUND_ORES & UNDERGROUND_DECORATION to make it easier to
//     // iterate
//     private static final List<GenerationStage.Decoration> decorations = new LinkedList<>();
//     static {
//         decorations.add(GenerationStage.Decoration.UNDERGROUND_ORES);
//         decorations.add(GenerationStage.Decoration.UNDERGROUND_DECORATION);
//     }
// 
//     @SubscribeEvent
//     public void onBiomesLoaded(BiomeLoadingEvent evt) {
//         BiomeGenerationSettingsBuilder settings = evt.getGeneration();
// 
//         // Removes vanilla ores
//         if (CommonConfig.REMOVE_VANILLA_ORES.get()) {
//             for (GenerationStage.Decoration deco : decorations) {
//                 FeatureUtils.destroyFeature(settings.getFeatures(deco),
//                         OreRemover.filterFeatures(settings.getFeatures(deco)));
//             }
//         }
// 
//         DepositFeature o = new DepositFeature(NoFeatureConfig.CODEC);
// 
//         settings.withFeature(GenerationStage.Decoration.UNDERGROUND_ORES,
//                 o.withConfiguration(NoFeatureConfig.NO_FEATURE_CONFIG));
//     }
// }
// 
// Path: src/main/java/com/oitsjustjose/geolosys/common/world/capability/IDepositCapability.java
// public interface IDepositCapability extends INBTSerializable<CompoundNBT> {
//     boolean hasPlutonGenerated(ChunkPos pos);
// 
//     void setPlutonGenerated(ChunkPos pos);
// 
//     void putPendingBlock(BlockPos pos, BlockState state);
// 
//     BlockState getPendingBlock(BlockPos pos);
// 
//     ConcurrentLinkedQueue<ChunkPos> getGenMap();
// 
//     Map<BlockPos, BlockState> getPendingBlocks();
// 
//     boolean hasPlayerReceivedManual(UUID uuid);
// 
//     void setPlayerReceivedManual(UUID uuid);
// 
//     Map<UUID, Boolean> getGivenMap();
// }


// Path: src/main/java/com/oitsjustjose/geolosys/api/GeolosysAPI.java
import com.oitsjustjose.geolosys.common.world.PlutonRegistry;
import com.oitsjustjose.geolosys.common.world.capability.IDepositCapability;
import net.minecraft.block.BlockState;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import java.util.ArrayList;

package com.oitsjustjose.geolosys.api;



/**
 * The Geolosys API is intended for use by anyone who wants to tap into all the
 * locations that deposits exist Access is pretty easy, just reference this
 * class's currentWorldDeposits HashMap
 */
public class GeolosysAPI {
    @CapabilityInject(IDepositCapability.class)
    public static final Capability<IDepositCapability> GEOLOSYS_WORLD_CAPABILITY = null;
    // A collection of blocks to ignore in the OreConverter feature
    public static ArrayList<BlockState> oreConverterBlacklist = new ArrayList<>();
    // An instance of the registry for all generatable plutons
    public static PlutonRegistry plutonRegistry = new PlutonRegistry();