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

CyclopsMC / IntegratedDynamics / 22182611236

19 Feb 2026 12:53PM UTC coverage: 52.363% (-0.9%) from 53.26%
22182611236

push

github

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

2916 of 9054 branches covered (32.21%)

Branch coverage included in aggregate %.

17656 of 30233 relevant lines covered (58.4%)

3.03 hits per line

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

75.73
/src/main/java/org/cyclops/integrateddynamics/GeneralConfig.java
1
package org.cyclops.integrateddynamics;
2

3
import com.google.common.collect.Lists;
4
import com.google.common.collect.Maps;
5
import net.minecraft.IdentifierException;
6
import net.minecraft.resources.Identifier;
7
import net.neoforged.fml.event.config.ModConfigEvent;
8
import org.apache.logging.log4j.Level;
9
import org.cyclops.cyclopscore.config.ConfigurablePropertyCommon;
10
import org.cyclops.cyclopscore.config.ModConfigLocation;
11
import org.cyclops.cyclopscore.config.extendedconfig.DummyConfigCommon;
12
import org.cyclops.integrateddynamics.api.part.IPartType;
13
import org.cyclops.integrateddynamics.core.part.PartTypes;
14

15
import java.util.List;
16
import java.util.Map;
17
import java.util.Objects;
18

19
/**
20
 * A config with general options for this mod.
21
 * @author rubensworks
22
 *
23
 */
24
public class GeneralConfig extends DummyConfigCommon<IntegratedDynamics> {
25

26
    @ConfigurablePropertyCommon(category = "core", comment = "If an anonymous mod startup analytics request may be sent to our analytics service.")
27
    public static boolean analytics = true;
2✔
28

29
    @ConfigurablePropertyCommon(category = "core", comment = "If the version checker should be enabled.")
30
    public static boolean versionChecker = true;
2✔
31

32
    @ConfigurablePropertyCommon(category = "machine", comment = "The default update frequency in ticks to use for new parts.", minimalValue = 1, configLocation = ModConfigLocation.SERVER)
33
    public static int defaultPartUpdateFreq = 1;
2✔
34

35
    @ConfigurablePropertyCommon(category = "general", comment = "The energy usage multiplier for networks.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
36
    public static int energyConsumptionMultiplier = 0;
2✔
37

38
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the audio reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
39
    public static int audioReaderBaseConsumption = 1;
2✔
40
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the audio writer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
41
    public static int audioWriterBaseConsumption = 1;
2✔
42
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the block reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
43
    public static int blockReaderBaseConsumption = 1;
2✔
44
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the mono-directional connector.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
45
    public static int connectorMonoDirectionalBaseConsumption = 32;
2✔
46
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the omni-directional connector.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
47
    public static int connectorOmniDirectionalBaseConsumption = 128;
2✔
48
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the effect writer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
49
    public static int effectWriterBaseConsumption = 1;
2✔
50
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the entity reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
51
    public static int entityReaderBaseConsumption = 1;
2✔
52
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the entity writer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
53
    public static int entityWriterBaseConsumption = 1;
2✔
54
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the extra-dimensional reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
55
    public static int extraDimensionalReaderBaseConsumption = 1;
2✔
56
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the fluid reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
57
    public static int fluidReaderBaseConsumption = 1;
2✔
58
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the inventory reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
59
    public static int inventoryReaderBaseConsumption = 1;
2✔
60
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the inventory writer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
61
    public static int inventoryWriterBaseConsumption = 1;
2✔
62
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the machine reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
63
    public static int machineReaderBaseConsumption = 1;
2✔
64
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the machine writer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
65
    public static int machineWriterBaseConsumption = 1;
2✔
66
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the materializer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
67
    public static int materializerBaseConsumption = 1;
2✔
68
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the network reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
69
    public static int networkReaderBaseConsumption = 1;
2✔
70
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the display panel when it has a variable.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
71
    public static int panelDisplayBaseConsumptionEnabled = 2;
2✔
72
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the display panel when does not have a variable.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
73
    public static int panelDisplayBaseConsumptionDisabled = 1;
2✔
74
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the dynamic light panel.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
75
    public static int panelLightDynamicBaseConsumption = 0;
2✔
76
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the static light panel.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
77
    public static int panelLightStaticBaseConsumption = 0;
2✔
78
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the proxy.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
79
    public static int proxyBaseConsumption = 2;
2✔
80
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the redstone reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
81
    public static int redstoneReaderBaseConsumption = 1;
2✔
82
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the redstone writer.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
83
    public static int redstoneWriterBaseConsumption = 1;
2✔
84
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the variable store.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
85
    public static int variablestoreBaseConsumption = 4;
2✔
86
    @ConfigurablePropertyCommon(category = "general", comment = "The base energy usage for the world reader.", minimalValue = 0, configLocation = ModConfigLocation.SERVER)
87
    public static int worldReaderBaseConsumption = 1;
2✔
88

89
    @ConfigurablePropertyCommon(category = "general", comment = "The maximum render distance for part overlays to render. The higher, the more resource intensive.", isCommandable = true, minimalValue = 1, configLocation = ModConfigLocation.CLIENT)
90
    public static int partOverlayRenderdistance = 15;
2✔
91

92
    @ConfigurablePropertyCommon(category = "core", comment = "If cable models should be cached for rendering optimization.", isCommandable = true, configLocation = ModConfigLocation.CLIENT)
93
    public static boolean cacheCableModels = true;
2✔
94

95
    @ConfigurablePropertyCommon(category = "core", comment = "The maximum network energy transfer rate.", isCommandable = true, minimalValue = 0, configLocation = ModConfigLocation.SERVER)
96
    public static int energyRateLimit = Integer.MAX_VALUE;
2✔
97

98
    @ConfigurablePropertyCommon(category = "machine", comment = "The maximum offset in blocks a directional connector can look for its target.", minimalValue = 1, configLocation = ModConfigLocation.SERVER)
99
    public static int maxDirectionalConnectorOffset = 512;
2✔
100

101
    @ConfigurablePropertyCommon(category = "machine", comment = "The NBT tags that are not allowed to be read by displaying NBT tags or performing operations on them.", configLocation = ModConfigLocation.SERVER)
102
    public static List<String> nbtTagBlacklist = Lists.newArrayList(); // Tag names that have to be ignored
2✔
103

104
    @ConfigurablePropertyCommon(category = "core", comment = "When enabled, networks will stop ticking and values will not be shown and evaluated again. This can be used to fix crashing networks by temporarily enabling this option.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
105
    public static boolean safeMode = false;
2✔
106

107
    @ConfigurablePropertyCommon(category = "core", comment = "The fastest possible frequency in ticks at which ingredient network should be observed.", minimalValue = 1, isCommandable = true, configLocation = ModConfigLocation.SERVER)
108
    public static int ingredientNetworkObserverFrequencyMin = 5;
2✔
109

110
    @ConfigurablePropertyCommon(category = "core", comment = "The slowest possible frequency in ticks at which ingredient network should be observed.", minimalValue = 1, isCommandable = true, configLocation = ModConfigLocation.SERVER)
111
    public static int ingredientNetworkObserverFrequencyMax = 40;
2✔
112

113
    @ConfigurablePropertyCommon(category = "core", comment = "The ingredient network observation frequency slowdown rate in ticks.", minimalValue = 1, isCommandable = true, configLocation = ModConfigLocation.SERVER)
114
    public static int ingredientNetworkObserverFrequencyIncreaseFactor = 1;
2✔
115

116
    @ConfigurablePropertyCommon(category = "core", comment = "The ingredient network observation frequency slowdown rate in ticks.", minimalValue = 1, isCommandable = true, configLocation = ModConfigLocation.SERVER)
117
    public static int ingredientNetworkObserverFrequencyDecreaseFactor = 5;
2✔
118

119
    @ConfigurablePropertyCommon(category = "core", comment = "The frequency in ticks at which ingredient network should be observed after a position's contents are changed.", minimalValue = 0, isCommandable = true, configLocation = ModConfigLocation.SERVER)
120
    public static int ingredientNetworkObserverFrequencyForced = 0;
2✔
121

122
    @ConfigurablePropertyCommon(category = "core", comment = "The number of threads that the ingredient network observer can use.", minimalValue = 1, requiresMcRestart = true, configLocation = ModConfigLocation.SERVER)
123
    public static int ingredientNetworkObserverThreads = 4;
2✔
124

125
    @ConfigurablePropertyCommon(category = "core", comment = "If the ingredient network observer can work on separate thread.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
126
    public static boolean ingredientNetworkObserverEnableMultithreading = true;
2✔
127

128
    @ConfigurablePropertyCommon(category = "core", comment = "If network change events should be logged. Only enable this when debugging.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
129
    public static boolean logChangeEvents = false;
2✔
130

131
    @ConfigurablePropertyCommon(category = "core", comment = "If variable card IDs should be logged during evaluation. This is useful for debugging crashes caused by card evaluation.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
132
    public static boolean logCardEvaluation = false;
2✔
133

134
    @ConfigurablePropertyCommon(category = "core", comment = "How deep the recursion stack on an operator can become. This is to avoid game crashes when building things like the omega operator.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
135
    public static int operatorRecursionLimit = 256;
2✔
136

137
    @ConfigurablePropertyCommon(category = "machine", comment = "Priority list of mod id's when determining tag-based recipe outputs.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
138
    public static List<String> recipeTagOutputModPriorities = Lists.newArrayList();
2✔
139

140
    @ConfigurablePropertyCommon(category = "core", comment = "If corrupted networks should automatically be restored on first tick.", isCommandable = true, configLocation = ModConfigLocation.SERVER)
141
    public static boolean recreateCorruptedNetworks = true;
2✔
142

143
    @ConfigurablePropertyCommon(category = "core", comment = "The maximum frequency at which speach messages can be played in milliseconds.", isCommandable = true, configLocation = ModConfigLocation.CLIENT)
144
    public static int speachMaxFrequency = 1000;
2✔
145

146
    @ConfigurablePropertyCommon(category = "core" , comment = "When true, use the LONG number format style. Otherwise, use the SHORT style.")
147
    public static boolean numberCompactUseLongStyle = false;
2✔
148

149
    @ConfigurablePropertyCommon(category = "core" , comment = "The maximum number of fractional digits to include in the result of the compact operator")
150
    public static int numberCompactMaximumFractionDigits = 2;
2✔
151

152
    @ConfigurablePropertyCommon(category = "core" , comment = "The minimum number of fractional digits to include in the result of the compact operator")
153
    public static int numberCompactMinimumFractionDigits = 0;
2✔
154

155
    @ConfigurablePropertyCommon(category = "core" , comment = "The maximum number of integer digits to include in the result of the compact operator")
156
    public static int numberCompactMaximumIntegerDigits = 3;
2✔
157

158
    @ConfigurablePropertyCommon(category = "core" , comment = "The minimum number of integer digits to include in the result of the compact operator")
159
    public static int numberCompactMinimumIntegerDigits = 1;
2✔
160

161
    @ConfigurablePropertyCommon(category = "general", comment = "The default port for running the network diagnostics HTTP server.", configLocation = ModConfigLocation.CLIENT)
162
    public static int diagnosticsWebServerPort = 3030;
2✔
163

164
    @ConfigurablePropertyCommon(category = "machine", comment = "The maximum offset in blocks a part can target.", minimalValue = 1, configLocation = ModConfigLocation.SERVER)
165
    public static int maxPartOffset = 32;
2✔
166

167
    @ConfigurablePropertyCommon(category = "machine", comment = "The distance from which part offsets should be shown.", minimalValue = 1, configLocation = ModConfigLocation.SERVER)
168
    public static int partOffsetRenderDistance = 16;
2✔
169

170
    @ConfigurablePropertyCommon(category = "machine", comment = "The maximum values that Part Offset items will have when dropped from a broken part.", minimalValue = 1, configLocation = ModConfigLocation.SERVER)
171
    public static int enchancementOffsetPartDropValue = 4;
2✔
172

173
    @ConfigurablePropertyCommon(category = "machine" , comment = "When true, disable the collision for cable.", configLocation = ModConfigLocation.SERVER)
174
    public static boolean disableCableCollision = false;
2✔
175

176
    @ConfigurablePropertyCommon(category = "general", comment = "The minimum update interval to enforce for all parts, in number of ticks.", configLocation = ModConfigLocation.SERVER)
177
    public static int partsMinimumUpdateInterval = 1;
2✔
178
    @ConfigurablePropertyCommon(category = "general", comment = "The minimum update intervals to enforce for specific parts. You can add entries in the form of 'integrateddynamics:machine_reader:10', where '10' refers to the number of ticks.", configLocation = ModConfigLocation.SERVER)
179
    public static List<String> partMinimumUpdateIntervals = Lists.newArrayList();
2✔
180
    public static Map<IPartType<?, ?>, Integer> partMinimumUpdateIntervalsMap = Maps.newIdentityHashMap();
2✔
181

182
    @ConfigurablePropertyCommon(category = "core" , comment = "When true, network elements will tick, irrespective of whether their chunk is loaded or not.", configLocation = ModConfigLocation.SERVER, isCommandable = true)
183
    public static boolean tickUnloadedNetworkElements = false;
3✔
184

185
    public GeneralConfig() {
186
        super(IntegratedDynamics._instance, "general");
4✔
187
        IntegratedDynamics._instance.getModEventBus().addListener(this::onConfigLoad);
5✔
188
        IntegratedDynamics._instance.getModEventBus().addListener(this::onConfigReload);
5✔
189
    }
1✔
190

191
    public void onConfigLoad(ModConfigEvent.Loading event) {
192
        if (Objects.equals(event.getConfig().getModId(), Reference.MOD_ID)) {
6!
193
            recreatePartMinimumUpdateIntervals();
2✔
194
        }
195
    }
1✔
196

197
    public void onConfigReload(ModConfigEvent.Loading event) {
198
        if (Objects.equals(event.getConfig().getModId(), Reference.MOD_ID)) {
6!
199
            recreatePartMinimumUpdateIntervals();
2✔
200
        }
201
    }
1✔
202

203
    private void recreatePartMinimumUpdateIntervals() {
204
        partMinimumUpdateIntervalsMap = Maps.newIdentityHashMap();
2✔
205
        for (String entry : partMinimumUpdateIntervals) {
6!
206
            int lastColon = entry.lastIndexOf(":");
×
207
            if (lastColon == -1) {
×
208
                IntegratedDynamics.clog(Level.WARN, "Error while reloading config entry partMinimumUpdateIntervals: Invalid entry " + entry);
×
209
                continue;
×
210
            }
211
            String partType = entry.substring(0, lastColon);
×
212
            int interval;
213
            try {
214
                interval = Integer.parseInt(entry.substring(lastColon + 1));
×
215
            } catch (NumberFormatException e) {
×
216
                IntegratedDynamics.clog(Level.WARN, "Error while reloading config entry partMinimumUpdateIntervals: Invalid interval integer in " + entry);
×
217
                continue;
×
218
            }
×
219
            try {
220
                IPartType<?, ?> part = PartTypes.REGISTRY.getPartType(Identifier.tryParse(partType));
×
221
                if (part != null) {
×
222
                    partMinimumUpdateIntervalsMap.put(part, interval);
×
223
                } else {
224
                    IntegratedDynamics.clog(Level.WARN, "Error while reloading config entry partMinimumUpdateIntervals: Could not find a part with id " + partType);
×
225
                }
226
            } catch (IdentifierException e) {
×
227
                IntegratedDynamics.clog(Level.WARN, "Error while reloading config entry partMinimumUpdateIntervals: " + e.getMessage());
×
228
            }
×
229
        }
×
230
    }
1✔
231

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