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

CyclopsMC / CommonCapabilities / #479006687

pending completion
#479006687

push

github-actions

rubensworks
Update to MC 1.19.4

35 of 35 new or added lines in 13 files covered. (100.0%)

889 of 2221 relevant lines covered (40.03%)

0.4 hits per line

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

66.67
/src/main/java/org/cyclops/commoncapabilities/IngredientComponents.java
1
package org.cyclops.commoncapabilities;
2

3
import com.google.common.collect.Lists;
4
import net.minecraft.world.level.material.Fluid;
5
import net.minecraft.world.item.Item;
6
import net.minecraft.world.item.ItemStack;
7
import net.minecraft.nbt.CompoundTag;
8
import net.minecraft.resources.ResourceLocation;
9
import net.minecraftforge.common.capabilities.ForgeCapabilities;
10
import net.minecraftforge.fluids.FluidStack;
11
import org.cyclops.commoncapabilities.api.capability.fluidhandler.FluidMatch;
12
import org.cyclops.commoncapabilities.api.capability.itemhandler.ItemMatch;
13
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
14
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponentCategoryType;
15
import org.cyclops.commoncapabilities.capability.itemhandler.SlotlessItemHandlerConfig;
16
import org.cyclops.commoncapabilities.ingredient.IngredientMatcherEnergy;
17
import org.cyclops.commoncapabilities.ingredient.IngredientMatcherFluidStack;
18
import org.cyclops.commoncapabilities.ingredient.IngredientMatcherItemStack;
19
import org.cyclops.commoncapabilities.ingredient.IngredientSerializerEnergy;
20
import org.cyclops.commoncapabilities.ingredient.IngredientSerializerFluidStack;
21
import org.cyclops.commoncapabilities.ingredient.IngredientSerializerItemStack;
22
import org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerEnergyStorage;
23
import org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerFluidStack;
24
import org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerItemStack;
25
import org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerItemStackSlotless;
26

27
/**
28
 * The ingredient components that will be registered by this mod.
29
 *
30
 * These should not be used directly, get their instances via the registry instead!
31
 *
32
 * @author rubensworks
33
 */
34
public class IngredientComponents {
×
35

36
    public static final IngredientComponent<ItemStack, Integer> ITEMSTACK =
1✔
37
            new IngredientComponent<>("minecraft:itemstack", new IngredientMatcherItemStack(),
38
                    new IngredientSerializerItemStack(), Lists.newArrayList(
1✔
39
                    new IngredientComponentCategoryType<>(new ResourceLocation("itemstack/item"),
40
                            Item.class, true,ItemStack::getItem, ItemMatch.ITEM, false),
1✔
41
                    new IngredientComponentCategoryType<>(new ResourceLocation("itemstack/count"),
42
                            Integer.class, false, ItemStack::getCount, ItemMatch.STACKSIZE, true),
1✔
43
                    new IngredientComponentCategoryType<>(new ResourceLocation("itemstack/tag"),
44
                            CompoundTag.class, false, ItemStack::getTag, ItemMatch.TAG, false)
1✔
45
            )).setTranslationKey("recipecomponent.minecraft.itemstack");
1✔
46

47
    public static final IngredientComponent<FluidStack, Integer> FLUIDSTACK =
1✔
48
            new IngredientComponent<>("minecraft:fluidstack", new IngredientMatcherFluidStack(),
49
                    new IngredientSerializerFluidStack(), Lists.newArrayList(
1✔
50
                    new IngredientComponentCategoryType<>(new ResourceLocation("fluidstack/fluid"),
51
                            Fluid.class, true, FluidStack::getFluid, FluidMatch.FLUID, false),
1✔
52
                    new IngredientComponentCategoryType<>(new ResourceLocation("fluidstack/amount"),
53
                            Integer.class, false, FluidStack::getAmount, FluidMatch.AMOUNT, true),
1✔
54
                    new IngredientComponentCategoryType<>(new ResourceLocation("fluidstack/tag"),
55
                            CompoundTag.class, false, FluidStack::getTag, FluidMatch.TAG, false)
1✔
56
            )).setTranslationKey("recipecomponent.minecraft.fluidstack");
1✔
57

58
    public static final IngredientComponent<Long, Boolean> ENERGY =
1✔
59
            new IngredientComponent<>("minecraft:energy", new IngredientMatcherEnergy(),
60
                    new IngredientSerializerEnergy(), Lists.newArrayList(
1✔
61
                    new IngredientComponentCategoryType<>(new ResourceLocation("energy/amount"),
62
                            Long.class, false, amount -> amount, true, true)
1✔
63
            )).setTranslationKey("recipecomponent.minecraft.energy");
1✔
64

65
    public static void registerStorageWrapperHandlers() {
66
        ENERGY.setStorageWrapperHandler(ForgeCapabilities.ENERGY, new IngredientComponentStorageWrapperHandlerEnergyStorage(ENERGY));
×
67
        ITEMSTACK.setStorageWrapperHandler(ForgeCapabilities.ITEM_HANDLER, new IngredientComponentStorageWrapperHandlerItemStack(ITEMSTACK));
×
68
        ITEMSTACK.setStorageWrapperHandler(SlotlessItemHandlerConfig.CAPABILITY, new IngredientComponentStorageWrapperHandlerItemStackSlotless(ITEMSTACK));
×
69
        IngredientComponentStorageWrapperHandlerFluidStack fluidWrapper = new IngredientComponentStorageWrapperHandlerFluidStack(FLUIDSTACK);
×
70
        FLUIDSTACK.setStorageWrapperHandler(ForgeCapabilities.FLUID_HANDLER, fluidWrapper);
×
71
        FLUIDSTACK.setStorageWrapperHandler(ForgeCapabilities.FLUID_HANDLER_ITEM, fluidWrapper);
×
72
    }
×
73

74
}
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