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

CyclopsMC / IntegratedDynamics / 18384427956

09 Oct 2025 05:46PM UTC coverage: 53.031% (-0.04%) from 53.071%
18384427956

push

github

rubensworks
Merge remote-tracking branch 'origin/master-1.21-lts' into master-1.21

2863 of 8762 branches covered (32.68%)

Branch coverage included in aggregate %.

17326 of 29308 relevant lines covered (59.12%)

3.07 hits per line

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

23.53
/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
                if (operators.isEmpty()) {
×
84
                    operators = Lists.newArrayList();
×
85
                    for (IOperator operator : Operators.REGISTRY.getOperators()) {
×
86
                        if (operator.getUniqueName().toString().matches(categoryName)) {
×
87
                            operators.add(operator);
×
88
                        }
89
                    }
×
90
                }
91
                List<SectionAppendix> appendices = Lists.newArrayList();
×
92
                for (IOperator operator : operators) {
×
93
                    appendices.add(new OperatorAppendix(infoBook, operator));
×
94
                }
×
95
                return appendices;
×
96
            }
97
        });
98
    }
1✔
99

100
    private OnTheDynamicsOfIntegrationBook() {
101
        super(IntegratedDynamics._instance, 2, Reference.BOOK_URL);
5✔
102
    }
1✔
103

104
    public static synchronized OnTheDynamicsOfIntegrationBook getInstance() {
105
        if(_instance == null) {
2!
106
            _instance = new OnTheDynamicsOfIntegrationBook();
4✔
107
        }
108
        return _instance;
2✔
109
    }
110
}
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