// Path: src/main/java/org/cyclops/integratedtunnels/Capabilities.java
// public class Capabilities {
//     @CapabilityInject(IEnergyNetwork.class)
//     public static Capability<IEnergyNetwork> NETWORK_ENERGY = null;
//     @CapabilityInject(IFluidNetwork.class)
//     public static Capability<IFluidNetwork> NETWORK_FLUID = null;
//     @CapabilityInject(IInventoryState.class)
//     public static Capability<IInventoryState> INVENTORY_STATE = null;
//     @CapabilityInject(ISlotlessItemHandler.class)
//     public static Capability<ISlotlessItemHandler> SLOTLESS_ITEMHANDLER = null;
// }
// 
// Path: src/main/java/org/cyclops/integratedtunnels/core/part/PartStateRoundRobin.java
// public class PartStateRoundRobin<P extends IPartTypeWriter> extends PartStateWriterBase<P> {
// 
//     private IPartPosIteratorHandler partPosIteratorHandler = null;
// 
//     public PartStateRoundRobin(int inventorySize) {
//         super(inventorySize);
//     }
// 
//     public void setPartPosIteratorHandler(IPartPosIteratorHandler partPosIteratorHandler) {
//         this.partPosIteratorHandler = partPosIteratorHandler;
//     }
// 
//     public IPartPosIteratorHandler getPartPosIteratorHandler() {
//         return partPosIteratorHandler;
//     }
// }


import net.minecraft.util.Direction;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
import org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage;
import org.cyclops.integrateddynamics.api.network.IEnergyNetwork;
import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectProperties;
import org.cyclops.integratedtunnels.Capabilities;
import org.cyclops.integratedtunnels.core.part.PartStateRoundRobin;
import javax.annotation.Nullable;
package org.cyclops.integratedtunnels.part.aspect;



/**
 * @author rubensworks
 */
public class EnergyTargetCapabilityProvider extends ChanneledTargetCapabilityProvider<IEnergyNetwork, Long, Boolean>
        implements IEnergyTarget {

    // TODO: in next breaking change, migrate to long values
    private final int amount;
    private final boolean exactAmount;

    public EnergyTargetCapabilityProvider(@Nullable ICapabilityProvider capabilityProvider, Direction side, INetwork network,
                                          IAspectProperties properties,
                                          int amount, @Nullable PartStateRoundRobin<?> partStateEnergy) {
// Path: src/main/java/org/cyclops/integratedtunnels/Capabilities.java
// public class Capabilities {
//     @CapabilityInject(IEnergyNetwork.class)
//     public static Capability<IEnergyNetwork> NETWORK_ENERGY = null;
//     @CapabilityInject(IFluidNetwork.class)
//     public static Capability<IFluidNetwork> NETWORK_FLUID = null;
//     @CapabilityInject(IInventoryState.class)
//     public static Capability<IInventoryState> INVENTORY_STATE = null;
//     @CapabilityInject(ISlotlessItemHandler.class)
//     public static Capability<ISlotlessItemHandler> SLOTLESS_ITEMHANDLER = null;
// }
// 
// Path: src/main/java/org/cyclops/integratedtunnels/core/part/PartStateRoundRobin.java
// public class PartStateRoundRobin<P extends IPartTypeWriter> extends PartStateWriterBase<P> {
// 
//     private IPartPosIteratorHandler partPosIteratorHandler = null;
// 
//     public PartStateRoundRobin(int inventorySize) {
//         super(inventorySize);
//     }
// 
//     public void setPartPosIteratorHandler(IPartPosIteratorHandler partPosIteratorHandler) {
//         this.partPosIteratorHandler = partPosIteratorHandler;
//     }
// 
//     public IPartPosIteratorHandler getPartPosIteratorHandler() {
//         return partPosIteratorHandler;
//     }
// }


// Path: src/main/java/org/cyclops/integratedtunnels/part/aspect/EnergyTargetCapabilityProvider.java
import net.minecraft.util.Direction;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
import org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage;
import org.cyclops.integrateddynamics.api.network.IEnergyNetwork;
import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectProperties;
import org.cyclops.integratedtunnels.Capabilities;
import org.cyclops.integratedtunnels.core.part.PartStateRoundRobin;
import javax.annotation.Nullable;

package org.cyclops.integratedtunnels.part.aspect;



/**
 * @author rubensworks
 */
public class EnergyTargetCapabilityProvider extends ChanneledTargetCapabilityProvider<IEnergyNetwork, Long, Boolean>
        implements IEnergyTarget {

    // TODO: in next breaking change, migrate to long values
    private final int amount;
    private final boolean exactAmount;

    public EnergyTargetCapabilityProvider(@Nullable ICapabilityProvider capabilityProvider, Direction side, INetwork network,
                                          IAspectProperties properties,
                                          int amount, @Nullable PartStateRoundRobin<?> partStateEnergy) {
        super(network, capabilityProvider, side, network.getCapability(Capabilities.NETWORK_ENERGY).orElse(null), partStateEnergy,