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

CyclopsMC / IntegratedDynamics / 22181095263

19 Feb 2026 12:06PM UTC coverage: 46.172% (+1.7%) from 44.45%
22181095263

push

github

rubensworks
Add performance tests for appending parts

2836 of 8848 branches covered (32.05%)

Branch coverage included in aggregate %.

12409 of 24170 relevant lines covered (51.34%)

2.44 hits per line

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

76.79
/src/main/java/org/cyclops/integrateddynamics/command/CommandGenerateNetwork.java
1
package org.cyclops.integrateddynamics.command;
2

3
import com.mojang.brigadier.Command;
4
import com.mojang.brigadier.arguments.IntegerArgumentType;
5
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
6
import com.mojang.brigadier.context.CommandContext;
7
import com.mojang.brigadier.exceptions.CommandSyntaxException;
8
import net.minecraft.ChatFormatting;
9
import net.minecraft.commands.CommandSourceStack;
10
import net.minecraft.commands.Commands;
11
import net.minecraft.core.BlockPos;
12
import net.minecraft.core.Direction;
13
import net.minecraft.network.chat.Component;
14
import net.minecraft.server.level.ServerLevel;
15
import net.minecraft.world.item.ItemStack;
16
import org.cyclops.cyclopscore.command.argument.ArgumentTypeEnum;
17
import org.cyclops.integrateddynamics.RegistryEntries;
18
import org.cyclops.integrateddynamics.api.part.IPartType;
19
import org.cyclops.integrateddynamics.api.part.PartPos;
20
import org.cyclops.integrateddynamics.block.BlockCable;
21
import org.cyclops.integrateddynamics.blockentity.BlockEntityVariablestore;
22
import org.cyclops.integrateddynamics.core.evaluate.operator.Operators;
23
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeInteger;
24
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypes;
25
import org.cyclops.integrateddynamics.core.helper.CableHelpers;
26
import org.cyclops.integrateddynamics.core.helper.NetworkHelpers;
27
import org.cyclops.integrateddynamics.core.helper.PartHelpers;
28
import org.cyclops.integrateddynamics.core.part.PartTypeRegistry;
29
import org.cyclops.integrateddynamics.core.part.PartTypes;
30
import org.cyclops.integrateddynamics.gametest.GameTestHelpersIntegratedDynamics;
31
import org.cyclops.integrateddynamics.part.aspect.Aspects;
32
import org.cyclops.integrateddynamics.part.aspect.read.AspectReadBuilders;
33

34
import java.util.ArrayList;
35
import java.util.List;
36
import java.util.Random;
37

38
/**
39
 * Command for generating networks with different presets.
40
 * @author rubensworks
41
 */
42
public class CommandGenerateNetwork implements Command<CommandSourceStack> {
×
43

44
    public static LiteralArgumentBuilder<CommandSourceStack> make() {
45
        LiteralArgumentBuilder<CommandSourceStack> builder = Commands.literal("generatenetwork")
3✔
46
                .requires((commandSource) -> commandSource.hasPermission(2));
3✔
47

48
        // Add the preset subcommand with optional size/radius argument
49
        builder.then(Commands.argument("preset", new ArgumentTypeEnum(NetworkPreset.class))
14✔
50
                .executes(new CommandGenerateNetworkExecutor(true, false))
4✔
51
                .then(Commands.argument("size", IntegerArgumentType.integer(1, 1000))
8✔
52
                        .executes(new CommandGenerateNetworkExecutor(true, true))));
1✔
53

54
        return builder;
2✔
55
    }
56

57
    @Override
58
    public int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
59
        context.getSource().sendFailure(Component.literal("Please specify a preset: empty, idle, redstoneioclock, or clear")
×
60
                .withStyle(ChatFormatting.RED));
×
61
        return 0;
×
62
    }
63

64
    public enum NetworkPreset {
×
65
        EMPTY,
×
66
        IDLE,
×
67
        REDSTONEIOCLOCK,
×
68
        REDSTONEIOCLOCKVARIABLES,
×
69
        CLEAR
×
70
    }
71

72
    /**
73
     * Executor for the generatenetwork command.
74
     */
75
    public static class CommandGenerateNetworkExecutor implements Command<CommandSourceStack> {
76
        private final boolean hasPreset;
77
        private final boolean hasSize;
78

79
        public CommandGenerateNetworkExecutor(boolean hasPreset, boolean hasSize) {
2✔
80
            this.hasPreset = hasPreset;
3✔
81
            this.hasSize = hasSize;
3✔
82
        }
1✔
83

84
        @Override
85
        public int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
86
            if (!hasPreset) {
×
87
                context.getSource().sendFailure(Component.literal("Please specify a preset: empty, idle, redstoneioclock, or clear")
×
88
                        .withStyle(ChatFormatting.RED));
×
89
                return 0;
×
90
            }
91

92
            NetworkPreset preset = ArgumentTypeEnum.getValue(context, "preset", NetworkPreset.class);
×
93
            ServerLevel level = context.getSource().getLevel();
×
94
            BlockPos playerPos = BlockPos.containing(context.getSource().getPosition());
×
95
            int size = hasSize ? IntegerArgumentType.getInteger(context, "size") : getDefaultSize(preset);
×
96

97
            switch (preset) {
×
98
                case EMPTY:
99
                    context.getSource().sendSuccess(
×
100
                            () -> Component.literal("Generating network preset: empty (size: " + size + "x" + size + "x" + size + ")")
×
101
                                    .withStyle(ChatFormatting.GREEN),
×
102
                            true);
103
                    NetworkGenerationHelper.generateEmptyNetwork(level, playerPos.above(2), size);
×
104
                    break;
×
105
                case IDLE:
106
                    context.getSource().sendSuccess(
×
107
                            () -> Component.literal("Generating network preset: idle (size: " + size + "x" + size + "x" + size + ")")
×
108
                                    .withStyle(ChatFormatting.GREEN),
×
109
                            true);
110
                    NetworkGenerationHelper.generateIdleNetwork(level, playerPos.above(2), size);
×
111
                    break;
×
112
                case REDSTONEIOCLOCK:
113
                    context.getSource().sendSuccess(
×
114
                            () -> Component.literal("Generating network preset: redstoneioclock (size: " + size + "x" + size + "x" + size + ")")
×
115
                                    .withStyle(ChatFormatting.GREEN),
×
116
                            true);
117
                    NetworkGenerationHelper.generateRedstoneNetwork(level, playerPos.above(2), size);
×
118
                    break;
×
119
                case REDSTONEIOCLOCKVARIABLES:
120
                    context.getSource().sendSuccess(
×
121
                            () -> Component.literal("Generating network preset: redstoneioclockvariables (size: " + size + "x" + size + "x" + size + ")")
×
122
                                    .withStyle(ChatFormatting.GREEN),
×
123
                            true);
124
                    NetworkGenerationHelper.generateRedstoneNetworkVariables(level, playerPos.above(2), size);
×
125
                    break;
×
126
                case CLEAR:
127
                    context.getSource().sendSuccess(
×
128
                            () -> Component.literal("Clearing cables within radius: " + size)
×
129
                                    .withStyle(ChatFormatting.GREEN),
×
130
                            true);
131
                    NetworkGenerationHelper.clearCables(level, playerPos, size);
×
132
                    break;
133
            }
134

135
            return 1;
×
136
        }
137

138
        /**
139
         * Get the default size/radius for the given preset.
140
         */
141
        private int getDefaultSize(NetworkPreset preset) {
142
            return preset == NetworkPreset.CLEAR ? 50 : 25;
×
143
        }
144
    }
145

146
    /**
147
     * Helper class for network generation logic, shared between command and game tests.
148
     */
149
    public static class NetworkGenerationHelper {
×
150
        /**
151
         * Generate a size x size x size cube of only logic cables.
152
         */
153
        public static void generateEmptyNetwork(ServerLevel level, BlockPos startPos, int size) {
154
            List<BlockPos> placedPositions = new ArrayList<>();
4✔
155

156
            BlockCable.SKIP_NETWORK_INIT = true;
2✔
157
            try {
158
                for (int x = 0; x < size; x++) {
7✔
159
                    for (int y = 0; y < size; y++) {
7✔
160
                        for (int z = 0; z < size; z++) {
7✔
161
                            BlockPos pos = startPos.offset(x, y, z);
6✔
162
                            level.setBlock(pos, RegistryEntries.BLOCK_CABLE.value().defaultBlockState(), 2);
9✔
163
                            placedPositions.add(pos);
4✔
164
                        }
165
                    }
166
                }
167
            } finally {
168
                BlockCable.SKIP_NETWORK_INIT = false;
2✔
169
            }
170

171
            for (BlockPos pos : placedPositions) {
10✔
172
                CableHelpers.updateConnectionsNeighbours(level, pos, CableHelpers.ALL_SIDES);
4✔
173
            }
1✔
174

175
            NetworkHelpers.initNetwork(level, startPos, null);
5✔
176
        }
1✔
177

178
        /**
179
         * Generate a size x size x size cube of logic cables where all cables on the outer sides
180
         * contain random parts facing outwards.
181
         */
182
        public static void generateIdleNetwork(ServerLevel level, BlockPos startPos, int size) {
183
            generateEmptyNetwork(level, startPos, size);
4✔
184

185
            Random random = new Random();
4✔
186
            List<BlockPos> updatePositions = new ArrayList<>();
4✔
187

188
            addPartsToFace(level, startPos, size, 0, size - 1, size - 1, size - 1, 0, size - 1, Direction.UP, random, updatePositions);
21✔
189
            addPartsToFace(level, startPos, size, 0, size - 1, 0, 0, 0, size - 1, Direction.DOWN, random, updatePositions);
17✔
190
            addPartsToFace(level, startPos, size, 0, size - 1, 0, size - 1, 0, 0, Direction.NORTH, random, updatePositions);
17✔
191
            addPartsToFace(level, startPos, size, 0, size - 1, 0, size - 1, size - 1, size - 1, Direction.SOUTH, random, updatePositions);
21✔
192
            addPartsToFace(level, startPos, size, 0, 0, 0, size - 1, 0, size - 1, Direction.WEST, random, updatePositions);
17✔
193
            addPartsToFace(level, startPos, size, size - 1, size - 1, 0, size - 1, 0, size - 1, Direction.EAST, random, updatePositions);
21✔
194

195
            for (BlockPos pos : updatePositions) {
10✔
196
                level.blockUpdated(pos, RegistryEntries.BLOCK_CABLE.value());
6✔
197
            }
1✔
198
        }
1✔
199

200
        /**
201
         * Place a single cable block at the given position.
202
         */
203
        public static void placeCable(ServerLevel level, BlockPos pos) {
204
            level.setBlock(pos, RegistryEntries.BLOCK_CABLE.value().defaultBlockState(), 2);
9✔
205
        }
1✔
206

207
        /**
208
         * Add a random part to the NORTH face of a cable at the given position.
209
         */
210
        public static void addPartToNorthFace(ServerLevel level, BlockPos pos) {
211
            List<IPartType> partTypes = new ArrayList<>(PartTypeRegistry.getInstance().getPartTypes());
6✔
212

213
            if (partTypes.isEmpty()) {
3!
214
                return;
×
215
            }
216

217
            Random random = new Random();
4✔
218
            IPartType partType = partTypes.get(random.nextInt(partTypes.size()));
8✔
219
            ItemStack itemStack = new ItemStack(partType.getItem());
6✔
220
            PartHelpers.addPart(level, pos, Direction.NORTH, partType, itemStack);
7✔
221
        }
1✔
222

223
        /**
224
         * Clear all cable blocks within a radius of the given position.
225
         */
226
        public static void clearCables(ServerLevel level, BlockPos centerPos, int radius) {
227
            BlockCable.SKIP_NETWORK_INIT = true;
2✔
228

229
            try {
230
                for (int x = centerPos.getX() - radius; x <= centerPos.getX() + radius; x++) {
13✔
231
                    for (int y = centerPos.getY() - radius; y <= centerPos.getY() + radius; y++) {
13✔
232
                        for (int z = centerPos.getZ() - radius; z <= centerPos.getZ() + radius; z++) {
13✔
233
                            BlockPos pos = new BlockPos(x, y, z);
7✔
234
                            if (level.getBlockState(pos).getBlock() == RegistryEntries.BLOCK_CABLE.value()) {
7✔
235
                                level.destroyBlock(pos, false);
5✔
236
                            }
237
                        }
238
                    }
239
                }
240
            } finally {
241
                BlockCable.SKIP_NETWORK_INIT = false;
2✔
242
            }
243
        }
1✔
244

245
        private static void addPartsToFace(ServerLevel level, BlockPos startPos, int size,
246
                                          int minX, int maxX, int minY, int maxY, int minZ, int maxZ,
247
                                          Direction side, Random random, List<BlockPos> updatePositions) {
248
            for (int x = minX; x <= maxX; x++) {
7✔
249
                for (int y = minY; y <= maxY; y++) {
7✔
250
                    for (int z = minZ; z <= maxZ; z++) {
7✔
251
                        BlockPos pos = startPos.offset(x, y, z);
6✔
252
                        addRandomPartDeferred(level, pos, side, random, updatePositions);
6✔
253
                    }
254
                }
255
            }
256
        }
1✔
257

258
        private static void addRandomPartDeferred(ServerLevel level, BlockPos pos, Direction side, Random random, List<BlockPos> updatePositions) {
259
            List<IPartType> partTypes = new ArrayList<>(PartTypeRegistry.getInstance().getPartTypes());
6✔
260

261
            if (partTypes.isEmpty()) {
3!
262
                return;
×
263
            }
264

265
            IPartType partType = partTypes.get(random.nextInt(partTypes.size()));
8✔
266
            ItemStack itemStack = new ItemStack(partType.getItem());
6✔
267
            PartHelpers.addPart(level, pos, side, partType, itemStack);
7✔
268
            updatePositions.add(pos);
4✔
269
        }
1✔
270

271
        /**
272
         * Generate a size x size x size cube of logic cables where all cables on the EAST side
273
         * contain redstone readers, and all cables on the WEST side contain redstone writers.
274
         * For each reader-writer pair at the same Y and Z coordinates, a variable is created
275
         * that reads the BOOLEAN_CLOCK aspect from the reader and connects it to the
276
         * BOOLEAN aspect of the writer at the opposite side.
277
         */
278
        public static void generateRedstoneNetwork(ServerLevel level, BlockPos startPos, int size) {
279
            generateEmptyNetwork(level, startPos, size);
4✔
280

281
            List<BlockPos> updatePositions = new ArrayList<>();
4✔
282

283
            // Add redstone readers to EAST side and redstone writers to WEST side
284
            // EAST side is at x = size - 1, WEST side is at x = 0
285
            for (int y = 0; y < size; y++) {
7✔
286
                for (int z = 0; z < size; z++) {
7✔
287
                    // EAST side: redstone reader
288
                    BlockPos eastPos = startPos.offset(size - 1, y, z);
8✔
289
                    PartHelpers.addPart(level, eastPos, Direction.EAST, PartTypes.REDSTONE_READER, new ItemStack(PartTypes.REDSTONE_READER.getItem()));
11✔
290
                    updatePositions.add(eastPos);
4✔
291

292
                    // WEST side: redstone writer
293
                    BlockPos westPos = startPos.offset(0, y, z);
6✔
294
                    PartHelpers.addPart(level, westPos, Direction.WEST, PartTypes.REDSTONE_WRITER, new ItemStack(PartTypes.REDSTONE_WRITER.getItem()));
11✔
295
                    updatePositions.add(westPos);
4✔
296
                }
297
            }
298

299
            // Update all positions and create variable connections
300
            for (BlockPos pos : updatePositions) {
10✔
301
                level.blockUpdated(pos, RegistryEntries.BLOCK_CABLE.value());
6✔
302
            }
1✔
303

304
            // Create variables connecting readers to writers
305
            for (int y = 0; y < size; y++) {
7✔
306
                for (int z = 0; z < size; z++) {
7✔
307
                    BlockPos eastPos = startPos.offset(size - 1, y, z);
8✔
308
                    BlockPos westPos = startPos.offset(0, y, z);
6✔
309

310
                    // Create variable from reader's BOOLEAN_CLOCK aspect
311
                    org.cyclops.integrateddynamics.api.part.PartPos eastPartPos = org.cyclops.integrateddynamics.api.part.PartPos.of(level, eastPos, Direction.EAST);
5✔
312
                    PartHelpers.PartStateHolder<?, ?> eastPartStateHolder = PartHelpers.getPart(eastPartPos);
3✔
313
                    if (eastPartStateHolder != null) {
2!
314
                        ItemStack variableCard = GameTestHelpersIntegratedDynamics.createVariableFromReader(level,
5✔
315
                                Aspects.Read.Redstone.BOOLEAN_CLOCK, eastPartStateHolder.getState());
1✔
316

317
                        // Place variable in writer's BOOLEAN aspect
318
                        org.cyclops.integrateddynamics.api.part.PartPos westPartPos = org.cyclops.integrateddynamics.api.part.PartPos.of(level, westPos, Direction.WEST);
5✔
319
                        GameTestHelpersIntegratedDynamics.placeVariableInWriter(level, westPartPos,
5✔
320
                                Aspects.Write.Redstone.BOOLEAN, variableCard);
321
                    }
322
                }
323
            }
324
        }
1✔
325

326
        /**
327
         * Generate a size x size x size cube of logic cables where all cables on the EAST side
328
         * contain redstone readers, and all cables on the WEST side contain redstone writers.
329
         * For each reader-writer pair at the same Y and Z coordinates, a CHOICE operator is created
330
         * that reads the BOOLEAN_CLOCK aspect from the reader and chooses between constants 0 and 10.
331
         * The result is written to the INTEGER aspect of the writer.
332
         * Variable cards are stored in variable store blocks placed on the SOUTH side of the network,
333
         * stacked vertically. Each variable store can hold multiple CHOICE operator configurations.
334
         * All redstone readers have PROPERTY_LENGTH set to 10.
335
         */
336
        public static void generateRedstoneNetworkVariables(ServerLevel level, BlockPos startPos, int size) {
337
            generateEmptyNetwork(level, startPos, size);
4✔
338

339
            List<BlockPos> updatePositions = new ArrayList<>();
4✔
340

341
            // Add redstone readers to EAST side and redstone writers to WEST side
342
            for (int y = 0; y < size; y++) {
7✔
343
                for (int z = 0; z < size; z++) {
7✔
344
                    // EAST side: redstone reader
345
                    BlockPos eastPos = startPos.offset(size - 1, y, z);
8✔
346
                    PartHelpers.addPart(level, eastPos, Direction.EAST, PartTypes.REDSTONE_READER, new ItemStack(PartTypes.REDSTONE_READER.getItem()));
11✔
347
                    updatePositions.add(eastPos);
4✔
348

349
                    // WEST side: redstone writer
350
                    BlockPos westPos = startPos.offset(0, y, z);
6✔
351
                    PartHelpers.addPart(level, westPos, Direction.WEST, PartTypes.REDSTONE_WRITER, new ItemStack(PartTypes.REDSTONE_WRITER.getItem()));
11✔
352
                    updatePositions.add(westPos);
4✔
353
                }
354
            }
355

356
            // Update all positions
357
            for (BlockPos pos : updatePositions) {
10✔
358
                level.blockUpdated(pos, RegistryEntries.BLOCK_CABLE.value());
6✔
359
            }
1✔
360

361
            // Create variable stores on the SOUTH side of the network
362
            // Place stores at (z = size, y varying) stacked vertically
363
            // Each store can hold 4 items: clock variable, constant 0, constant 10, and choice operator
364
            int storeX = startPos.getX(); // Aligned with the network
3✔
365
            int storeZ = startPos.getZ() + size; // SOUTH side
5✔
366
            int currentStoreY = startPos.getY();
3✔
367
            int currentSlot = 0;
2✔
368
            BlockEntityVariablestore currentVariableStore = null;
2✔
369
            BlockPos currentStorePos = null;
2✔
370

371
            // Create variables connecting readers to writers using CHOICE operator
372
            for (int y = 0; y < size; y++) {
7✔
373
                for (int z = 0; z < size; z++) {
7✔
374
                    BlockPos eastPos = startPos.offset(size - 1, y, z);
8✔
375
                    BlockPos westPos = startPos.offset(0, y, z);
6✔
376

377
                    // Get or create a new variable store if current one is full
378
                    if (currentVariableStore == null || currentSlot >= BlockEntityVariablestore.INVENTORY_SIZE) {
5✔
379
                        if (currentSlot >= BlockEntityVariablestore.INVENTORY_SIZE) {
3✔
380
                            // Current store is full, move to next store (stack vertically)
381
                            currentStoreY++;
1✔
382
                        }
383

384
                        currentStorePos = new BlockPos(storeX, currentStoreY, storeZ);
7✔
385
                        level.setBlock(currentStorePos, RegistryEntries.BLOCK_VARIABLE_STORE.get().defaultBlockState(), 2);
9✔
386
                        currentVariableStore = (BlockEntityVariablestore) level.getBlockEntity(currentStorePos);
5✔
387
                        currentSlot = 0;
2✔
388
                    }
389

390
                    if (currentVariableStore != null) {
2!
391
                        // Create variable from reader's BOOLEAN_CLOCK aspect
392
                        org.cyclops.integrateddynamics.api.part.PartPos eastPartPos = org.cyclops.integrateddynamics.api.part.PartPos.of(level, eastPos, Direction.EAST);
5✔
393
                        PartHelpers.PartStateHolder<?, ?> eastPartStateHolder = PartHelpers.getPart(eastPartPos);
3✔
394

395
                        if (eastPartStateHolder != null) {
2!
396
                            // Create constant integer variables (0 and 10) - reuse from first slot if already created
397
                            ItemStack variable0, variable10;
398
                            int variable0Id, variable10Id;
399

400
                            int currentSlotIncrement;
401
                            if (currentSlot == 0) {
2✔
402
                                // First time, create and store constants
403
                                variable0 = GameTestHelpersIntegratedDynamics.createVariableForValue(level, ValueTypes.INTEGER, ValueTypeInteger.ValueInteger.of(0));
6✔
404
                                variable10 = GameTestHelpersIntegratedDynamics.createVariableForValue(level, ValueTypes.INTEGER, ValueTypeInteger.ValueInteger.of(10));
6✔
405
                                currentVariableStore.getInventory().setItem(1, variable0);
5✔
406
                                currentVariableStore.getInventory().setItem(2, variable10);
5✔
407
                                variable0Id = GameTestHelpersIntegratedDynamics.getVariableFacade(level, variable0).getId();
5✔
408
                                variable10Id = GameTestHelpersIntegratedDynamics.getVariableFacade(level, variable10).getId();
5✔
409
                                currentSlotIncrement = 4;
3✔
410
                            } else {
411
                                // Reuse constants from slots 1 and 2
412
                                variable0Id = GameTestHelpersIntegratedDynamics.getVariableFacade(level, currentVariableStore.getInventory().getItem(1)).getId();
8✔
413
                                variable10Id = GameTestHelpersIntegratedDynamics.getVariableFacade(level, currentVariableStore.getInventory().getItem(2)).getId();
8✔
414
                                currentSlotIncrement = 2;
2✔
415
                            }
416

417
                            // Create variable from reader's BOOLEAN_CLOCK aspect
418
                            ItemStack variableClock = GameTestHelpersIntegratedDynamics.createVariableFromReader(level,
5✔
419
                                    Aspects.Read.Redstone.BOOLEAN_CLOCK, eastPartStateHolder.getState());
1✔
420
                            currentVariableStore.getInventory().setItem(currentSlot, variableClock);
5✔
421

422
                            // Create CHOICE operator variable
423
                            ItemStack variableChoice = GameTestHelpersIntegratedDynamics.createVariableForOperator(level, Operators.GENERAL_CHOICE, new int[]{
10✔
424
                                    GameTestHelpersIntegratedDynamics.getVariableFacade(level, variableClock).getId(),
11✔
425
                                    variable0Id,
426
                                    variable10Id
427
                            });
428
                            currentVariableStore.getInventory().setItem(currentSlot + currentSlotIncrement - 1, variableChoice);
9✔
429

430
                            // Place CHOICE variable in writer's INTEGER aspect
431
                            org.cyclops.integrateddynamics.api.part.PartPos westPartPos = org.cyclops.integrateddynamics.api.part.PartPos.of(level, westPos, Direction.WEST);
5✔
432
                            GameTestHelpersIntegratedDynamics.placeVariableInWriter(level, westPartPos,
5✔
433
                                    Aspects.Write.Redstone.INTEGER, variableChoice);
434

435
                            currentSlot += currentSlotIncrement;
4✔
436
                        }
437
                    }
438
                }
439
            }
440

441
            // Set PROPERTY_LENGTH to 10 for all redstone readers
442
            for (int y = 0; y < size; y++) {
7✔
443
                for (int z = 0; z < size; z++) {
7✔
444
                    BlockPos eastPos = startPos.offset(size - 1, y, z);
8✔
445
                    PartPos eastPartPos = PartPos.of(level, eastPos, Direction.EAST);
5✔
446
                    GameTestHelpersIntegratedDynamics.setAspectProperty(eastPartPos, Aspects.Read.Redstone.BOOLEAN_CLOCK, AspectReadBuilders.Redstone.PROPERTY_LENGTH, ValueTypeInteger.ValueInteger.of(10));
6✔
447
                }
448
            }
449
        }
1✔
450
    }
451
}
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