• 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

77.78
/src/main/java/org/cyclops/integrateddynamics/core/ingredient/IngredientComponentHandlerRegistry.java
1
package org.cyclops.integrateddynamics.core.ingredient;
2

3
import com.google.common.collect.Maps;
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
import org.cyclops.integrateddynamics.api.ingredient.IIngredientComponentHandler;
8
import org.cyclops.integrateddynamics.api.ingredient.IIngredientComponentHandlerRegistry;
9

10
import javax.annotation.Nullable;
11
import java.util.Map;
12
import java.util.Objects;
13
import java.util.Set;
14

15
/**
16
 * @author rubensworks
17
 */
18
public class IngredientComponentHandlerRegistry implements IIngredientComponentHandlerRegistry {
19

20
    private static IngredientComponentHandlerRegistry INSTANCE = new IngredientComponentHandlerRegistry();
5✔
21

22
    private final Map<IngredientComponent<?, ?>, IIngredientComponentHandler> componentTypes = Maps.newIdentityHashMap();
3✔
23

24
    private IngredientComponentHandlerRegistry() {
2✔
25

26
    }
1✔
27

28
    /**
29
     * @return The unique instance.
30
     */
31
    public static IngredientComponentHandlerRegistry getInstance() {
32
        return INSTANCE;
2✔
33
    }
34

35
    @Override
36
    public <VT extends IValueType<V>, V extends IValue,
37
            T, M, H extends IIngredientComponentHandler<VT, V, T, M>> H register(H handler) {
38
        this.componentTypes.put(Objects.requireNonNull(handler.getComponent(), "The recipe component of "
12✔
39
                + handler + " was null, it is probably not initialized yet!"), handler);
40
        return handler;
2✔
41
    }
42

43
    @Nullable
44
    @Override
45
    public <VT extends IValueType<V>, V extends IValue, T, M>
46
    IIngredientComponentHandler<VT, V, T, M> getComponentHandler(IngredientComponent<T, M> component) {
47
        return this.componentTypes.get(component);
×
48
    }
49

50
    @Override
51
    public Set<IngredientComponent<?, ?>> getComponents() {
52
        return this.componentTypes.keySet();
×
53
    }
54
}
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