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

CyclopsMC / IntegratedDynamics / 18385005714

09 Oct 2025 06:10PM UTC coverage: 53.023% (-0.008%) from 53.031%
18385005714

push

github

rubensworks
Deprecate IIngredientComponentHandler

2865 of 8762 branches covered (32.7%)

Branch coverage included in aggregate %.

17321 of 29308 relevant lines covered (59.1%)

3.07 hits per line

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

0.0
/src/main/java/org/cyclops/integrateddynamics/api/ingredient/IIngredientComponentHandler.java
1
package org.cyclops.integrateddynamics.api.ingredient;
2

3
import net.minecraft.network.chat.Component;
4
import org.cyclops.commoncapabilities.api.ingredient.IngredientComponent;
5
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
6
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueType;
7

8
import javax.annotation.Nullable;
9

10
/**
11
 * Handles the translation between {@link IngredientComponent} instances and {@link IValue}.
12
 * @param <VT> The value type.
13
 * @param <V> The value.
14
 * @param <T> The instance type.
15
 * @param <M> The matching condition parameter.
16
 * @author rubensworks
17
 */
18
@Deprecated // TODO: remove in next major in favor of org.cyclops.integrateddynamics.api.ingredient.capability.IIngredientComponentValueHandler
19
public interface IIngredientComponentHandler<VT extends IValueType<V>, V extends IValue, T, M> {
20

21
    /**
22
     * @return The value type with which the component should be handled.
23
     */
24
    public VT getValueType();
25

26
    /**
27
     * @return The recipe component.
28
     */
29
    public IngredientComponent<T, M> getComponent();
30

31
    /**
32
     * Convert an instance to a value.
33
     * @param instance A recipe component instance.
34
     * @return A value.
35
     */
36
    public V toValue(@Nullable T instance);
37

38
    /**
39
     * Convert a value to an instance.
40
     * @param value A value.
41
     * @return A recipe component instance.
42
     */
43
    @Nullable
44
    public T toInstance(V value);
45

46
    /**
47
     * Convert the given list of values to a compact string.
48
     * To be used in things like tooltips.
49
     * @param ingredientValue A list of ingredient values.
50
     * @return A compact string representation.
51
     */
52
    default public Component toCompactString(V ingredientValue) {
53
        return getValueType().toCompactString(ingredientValue);
×
54
    }
55

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

© 2025 Coveralls, Inc