• 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

75.0
/src/main/java/org/cyclops/integrateddynamics/capability/path/SidedPathElement.java
1
package org.cyclops.integrateddynamics.capability.path;
2

3
import net.minecraft.core.Direction;
4
import org.cyclops.cyclopscore.datastructure.DimPos;
5
import org.cyclops.integrateddynamics.api.path.IPathElement;
6
import org.cyclops.integrateddynamics.api.path.ISidedPathElement;
7
import org.cyclops.integrateddynamics.api.path.SidedPathElementParams;
8

9
import javax.annotation.Nullable;
10
import java.util.Optional;
11

12
/**
13
 * @author rubensworks
14
 */
15
public class SidedPathElement implements ISidedPathElement {
16

17
    private final IPathElement pathElement;
18
    private final Direction side;
19

20
    public SidedPathElement(IPathElement pathElement, @Nullable Direction side) {
2✔
21
        this.pathElement = pathElement;
3✔
22
        this.side = side;
3✔
23
    }
1✔
24

25
    @Override
26
    public IPathElement getPathElement() {
27
        return pathElement;
3✔
28
    }
29

30
    @Override
31
    @Nullable
32
    public Direction getSide() {
33
        return side;
3✔
34
    }
35

36
    @Override
37
    public SidedPathElementParams getParams() {
38
        DimPos pos = getPathElement().getPosition();
4✔
39
        return new SidedPathElementParams(pos.getLevel(), pos.getBlockPos(), Optional.ofNullable(getSide()));
11✔
40
    }
41

42
    @Override
43
    public boolean equals(Object o) {
44
        return o instanceof ISidedPathElement && compareTo((ISidedPathElement)o) == 0;
×
45
    }
46

47
    @Override
48
    public int compareTo(ISidedPathElement o) {
49
        int pathElement = getPathElement().getPosition().compareTo(o.getPathElement().getPosition());
8✔
50
        if (pathElement == 0) {
2✔
51
            Direction thisSide = getSide();
3✔
52
            Direction thatSide = o.getSide();
3✔
53
            // If one of the sides is null, assume equality
54
            return thisSide != null && thatSide != null ? thisSide.compareTo(thatSide) : 0;
10!
55
        }
56
        return pathElement;
2✔
57
    }
58

59
    @Override
60
    public int hashCode() {
61
        return getPathElement().getPosition().hashCode();
5✔
62
    }
63

64
    @Override
65
    public String toString() {
66
        return "[Sided PE: " + getPathElement().getPosition() + " @ " + getSide() + "]";
×
67
    }
68

69
    public static SidedPathElement of(IPathElement pathElement, @Nullable Direction side) {
70
        return new SidedPathElement(pathElement, side);
6✔
71
    }
72
}
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