• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 20210191346

14 Dec 2025 03:32PM UTC coverage: 19.514% (-33.5%) from 53.061%
20210191346

push

github

rubensworks
Remove deprecations

663 of 8728 branches covered (7.6%)

Branch coverage included in aggregate %.

6786 of 29445 relevant lines covered (23.05%)

1.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.86
/src/main/java/org/cyclops/integrateddynamics/capability/ingredient/IngredientComponentCapabilities.java
1
package org.cyclops.integrateddynamics.capability.ingredient;
2

3
import net.minecraft.resources.ResourceLocation;
4
import net.minecraft.world.item.ItemStack;
5
import net.neoforged.neoforge.capabilities.ICapabilityProvider;
6
import net.neoforged.neoforge.fluids.FluidStack;
7
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
8
import org.cyclops.commoncapabilities.api.ingredient.capability.IngredientComponentCapabilityAttacherAdapter;
9
import org.cyclops.commoncapabilities.api.ingredient.capability.IngredientComponentCapabilityAttacherManager;
10
import org.cyclops.cyclopscore.modcompat.capabilities.DefaultCapabilityProvider;
11
import org.cyclops.integrateddynamics.Capabilities;
12
import org.cyclops.integrateddynamics.api.ingredient.capability.IIngredientComponentValueHandler;
13
import org.cyclops.integrateddynamics.api.ingredient.capability.IPositionedAddonsNetworkIngredientsHandler;
14
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueObjectTypeFluidStack;
15
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueObjectTypeItemStack;
16
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeInteger;
17

18
import java.util.Optional;
19

20
/**
21
 * Value handlers for ingredient components.
22
 * @author rubensworks
23
 */
24
@Deprecated // TODO: try to rm in next major, as we have IIngredientComponentHandler and IIngredientComponentHandlerRegistry that do the same
25
public class IngredientComponentCapabilities {
×
26

27
    public static final ResourceLocation INGREDIENT_ITEMSTACK_NAME = ResourceLocation.fromNamespaceAndPath("minecraft", "itemstack");
4✔
28
    public static final ResourceLocation INGREDIENT_FLUIDSTACK_NAME = ResourceLocation.fromNamespaceAndPath("minecraft", "fluidstack");
4✔
29
    public static final ResourceLocation INGREDIENT_ENERGY_NAME = ResourceLocation.fromNamespaceAndPath("minecraft", "energy");
5✔
30

31
    public static void load() {
32
        IngredientComponentCapabilityAttacherManager attacherManager = new IngredientComponentCapabilityAttacherManager();
4✔
33

34
        // Value handlers
35
        attacherManager.addAttacher(new IngredientComponentCapabilityAttacherAdapter<ItemStack, Integer>(INGREDIENT_ITEMSTACK_NAME, Capabilities.IngredientComponentValueHandler.INGREDIENT) {
12✔
36
            @Override
37
            public ICapabilityProvider<IngredientComponent<?, ?>, Void, IIngredientComponentValueHandler<ValueObjectTypeItemStack, ValueObjectTypeItemStack.ValueItemStack, ItemStack, Integer>>
38
            createCapabilityProvider(IngredientComponent<ItemStack, Integer> ingredientComponent) {
39
                return (object, context) -> new IngredientComponentValueHandlerItemStack(ingredientComponent);
3✔
40
            }
41
        });
42
        attacherManager.addAttacher(new IngredientComponentCapabilityAttacherAdapter<FluidStack, Integer>(INGREDIENT_FLUIDSTACK_NAME, Capabilities.IngredientComponentValueHandler.INGREDIENT) {
12✔
43
            @Override
44
            public ICapabilityProvider<IngredientComponent<?, ?>, Void, IIngredientComponentValueHandler<ValueObjectTypeFluidStack, ValueObjectTypeFluidStack.ValueFluidStack, FluidStack, Integer>>
45
            createCapabilityProvider(IngredientComponent<FluidStack, Integer> ingredientComponent) {
46
                return (object, context) -> new IngredientComponentValueHandlerFluidStack(ingredientComponent);
3✔
47
            }
48
        });
49
        attacherManager.addAttacher(new IngredientComponentCapabilityAttacherAdapter<Integer, Boolean>(INGREDIENT_ENERGY_NAME, Capabilities.IngredientComponentValueHandler.INGREDIENT) {
12✔
50
            @Override
51
            public ICapabilityProvider<IngredientComponent<?, ?>, Void, IIngredientComponentValueHandler<ValueTypeInteger, ValueTypeInteger.ValueInteger, Integer, Boolean>>
52
            createCapabilityProvider(IngredientComponent<Integer, Boolean> ingredientComponent) {
53
                return (object, context) -> new IngredientComponentValueHandlerEnergy(ingredientComponent);
3✔
54
            }
55
        });
56

57
        // Network handler
58
        attacherManager.addAttacher(new IngredientComponentCapabilityAttacherAdapter<Integer, Boolean>(INGREDIENT_ENERGY_NAME, Capabilities.PositionedAddonsNetworkIngredientsHandler.INGREDIENT) {
12✔
59
            @Override
60
            public ICapabilityProvider<IngredientComponent<Integer, Boolean>, Void, IPositionedAddonsNetworkIngredientsHandler<Integer, Boolean>> createCapabilityProvider(IngredientComponent<Integer, Boolean> ingredientComponent) {
61
                return new DefaultCapabilityProvider<>(network -> (Optional) network.getCapability(Capabilities.EnergyNetwork.NETWORK));
5✔
62
            }
63
        });
64
    }
1✔
65

66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc