• 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

0.0
/src/main/java/org/cyclops/integrateddynamics/capability/path/PathElementCable.java
1
package org.cyclops.integrateddynamics.capability.path;
2

3
import com.google.common.collect.Sets;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.core.Direction;
6
import org.cyclops.cyclopscore.helper.IModHelpersNeoForge;
7
import org.cyclops.integrateddynamics.Capabilities;
8
import org.cyclops.integrateddynamics.IntegratedDynamics;
9
import org.cyclops.integrateddynamics.api.block.cable.ICable;
10
import org.cyclops.integrateddynamics.api.path.IPathElement;
11
import org.cyclops.integrateddynamics.api.path.ISidedPathElement;
12

13
import java.util.Set;
14

15
/**
16
 * Implementation of {@link IPathElement} for cables.
17
 * @author rubensworks
18
 */
19
public abstract class PathElementCable extends PathElementDefault {
×
20

21
    protected abstract ICable getCable();
22

23
    @Override
24
    public Set<ISidedPathElement> getReachableElements() {
25
        Set<ISidedPathElement> elements = Sets.newHashSet();
×
26
        BlockPos pos = getPosition().getBlockPos();
×
27
        for (Direction side : Direction.values()) {
×
28
            if (getCable().isConnected(side)) {
×
29
                BlockPos posOffset = pos.relative(side);
×
30
                Direction pathElementSide = side.getOpposite();
×
31
                IPathElement pathElement = IModHelpersNeoForge.get().getCapabilityHelpers().getCapability(getPosition().getLevel(true), posOffset, pathElementSide, Capabilities.PathElement.BLOCK).orElse(null);
×
32
                if (pathElement == null) {
×
33
                    IntegratedDynamics.clog(org.apache.logging.log4j.Level.ERROR, String.format("The position at %s was incorrectly marked " +
×
34
                            "as reachable as path element by %s at %s side %s.", posOffset, getCable(), pos, side));
×
35
                } else {
36
                    elements.add(SidedPathElement.of(pathElement, pathElementSide));
×
37
                }
38
            }
39
        }
40
        return elements;
×
41
    }
42
}
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