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

CyclopsMC / IntegratedDynamics / 16552051255

27 Jul 2025 01:58PM UTC coverage: 53.206% (+8.0%) from 45.161%
16552051255

push

github

rubensworks
Resolve minor TODOs

2888 of 8740 branches covered (33.04%)

Branch coverage included in aggregate %.

17341 of 29280 relevant lines covered (59.22%)

3.08 hits per line

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

28.57
/src/main/java/org/cyclops/integrateddynamics/infobook/OnTheDynamicsOfIntegrationBook.java
1
package org.cyclops.integrateddynamics.infobook;
2

3
import com.google.common.collect.Lists;
4
import net.minecraft.resources.ResourceLocation;
5
import org.cyclops.cyclopscore.infobook.IInfoBook;
6
import org.cyclops.cyclopscore.infobook.InfoBook;
7
import org.cyclops.cyclopscore.infobook.InfoBookParser;
8
import org.cyclops.cyclopscore.infobook.pageelement.SectionAppendix;
9
import org.cyclops.integrateddynamics.IntegratedDynamics;
10
import org.cyclops.integrateddynamics.Reference;
11
import org.cyclops.integrateddynamics.RegistryEntries;
12
import org.cyclops.integrateddynamics.api.evaluate.operator.IOperator;
13
import org.cyclops.integrateddynamics.api.part.IPartType;
14
import org.cyclops.integrateddynamics.api.part.aspect.IAspect;
15
import org.cyclops.integrateddynamics.core.evaluate.operator.Operators;
16
import org.cyclops.integrateddynamics.core.part.PartTypes;
17
import org.cyclops.integrateddynamics.infobook.pageelement.*;
18
import org.cyclops.integrateddynamics.part.aspect.Aspects;
19
import org.w3c.dom.Element;
20

21
import java.util.List;
22

23
/**
24
 * Infobook class for the On the Dynamics of Integration.
25
 * @author rubensworks
26
 */
27
public class OnTheDynamicsOfIntegrationBook extends InfoBook {
28

29
    private static OnTheDynamicsOfIntegrationBook _instance = null;
2✔
30

31
    static {
32
        InfoBookParser.registerAppendixRecipeFactories(RegistryEntries.RECIPETYPE_SQUEEZER.get(), SqueezerRecipeAppendix::new);
5✔
33
        InfoBookParser.registerAppendixRecipeFactories(RegistryEntries.RECIPETYPE_MECHANICAL_SQUEEZER.get(), MechanicalSqueezerRecipeAppendix::new);
5✔
34
        InfoBookParser.registerAppendixRecipeFactories(RegistryEntries.RECIPETYPE_DRYING_BASIN.get(), DryingBasinRecipeAppendix::new);
5✔
35
        InfoBookParser.registerAppendixRecipeFactories(RegistryEntries.RECIPETYPE_MECHANICAL_DRYING_BASIN.get(), MechanicalDryingBasinRecipeAppendix::new);
5✔
36

37
        InfoBookParser.registerAppendixFactory(Reference.MOD_ID + ":aspect", new InfoBookParser.IAppendixFactory() {
8✔
38
            @Override
39
            public SectionAppendix create(IInfoBook infoBook, Element node) throws InfoBookParser.InvalidAppendixException {
40
                String aspectName = node.getTextContent();
×
41
                IAspect aspect = Aspects.REGISTRY.getAspect(ResourceLocation.parse(aspectName));
×
42
                if (aspect == null) {
×
43
                    throw new InfoBookParser.InvalidAppendixException(String.format("Could not find an aspect by name %s.", aspectName));
×
44
                }
45
                return new AspectAppendix(infoBook, aspect);
×
46
            }
47
        });
48

49
        InfoBookParser.registerAppendixListFactory(Reference.MOD_ID + ":part_aspects", new InfoBookParser.IAppendixListFactory() {
8✔
50
            @Override
51
            public List<SectionAppendix> create(final IInfoBook infoBook, Element node) throws InfoBookParser.InvalidAppendixException {
52
                String partName = node.getTextContent();
×
53
                IPartType partType = PartTypes.REGISTRY.getPartType(ResourceLocation.parse(partName));
×
54
                if (partType == null) {
×
55
                    throw new InfoBookParser.InvalidAppendixException(String.format("Could not find a part type by name '%s'.", partName));
×
56
                }
57
                List<IAspect> aspects = Lists.newArrayList(Aspects.REGISTRY.getAspects(partType));
×
58
                List<SectionAppendix> appendices = Lists.newArrayList();
×
59
                for (IAspect aspect : aspects) {
×
60
                    appendices.add(new AspectAppendix(infoBook, aspect));
×
61
                }
×
62
                return appendices;
×
63
            }
64
        });
65

66
        InfoBookParser.registerAppendixFactory(Reference.MOD_ID + ":operator", new InfoBookParser.IAppendixFactory() {
8✔
67
            @Override
68
            public SectionAppendix create(IInfoBook infoBook, Element node) throws InfoBookParser.InvalidAppendixException {
69
                String operatorName = node.getTextContent();
×
70
                IOperator operator = Operators.REGISTRY.getOperator(ResourceLocation.parse(operatorName));
×
71
                if (operator == null) {
×
72
                    throw new InfoBookParser.InvalidAppendixException(String.format("Could not find an operator by name %s.", operatorName));
×
73
                }
74
                return new OperatorAppendix(infoBook, operator);
×
75
            }
76
        });
77

78
        InfoBookParser.registerAppendixListFactory(Reference.MOD_ID + ":operators_output", new InfoBookParser.IAppendixListFactory() {
8✔
79
            @Override
80
            public List<SectionAppendix> create(final IInfoBook infoBook, Element node) throws InfoBookParser.InvalidAppendixException {
81
                String categoryName = node.getTextContent();
×
82
                List<IOperator> operators = Lists.newArrayList("*".equals(categoryName) ? Operators.REGISTRY.getOperators() : Operators.REGISTRY.getOperatorsInCategory(categoryName));
×
83
                List<SectionAppendix> appendices = Lists.newArrayList();
×
84
                for (IOperator operator : operators) {
×
85
                    appendices.add(new OperatorAppendix(infoBook, operator));
×
86
                }
×
87
                return appendices;
×
88
            }
89
        });
90
    }
1✔
91

92
    private OnTheDynamicsOfIntegrationBook() {
93
        super(IntegratedDynamics._instance, 2, Reference.BOOK_URL);
5✔
94
    }
1✔
95

96
    public static synchronized OnTheDynamicsOfIntegrationBook getInstance() {
97
        if(_instance == null) {
2!
98
            _instance = new OnTheDynamicsOfIntegrationBook();
4✔
99
        }
100
        return _instance;
2✔
101
    }
102
}
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