• 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/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) {
×
21
        this.pathElement = pathElement;
×
22
        this.side = side;
×
23
    }
×
24

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

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

36
    @Override
37
    public SidedPathElementParams getParams() {
38
        DimPos pos = getPathElement().getPosition();
×
39
        return new SidedPathElementParams(pos.getLevel(), pos.getBlockPos(), Optional.ofNullable(getSide()));
×
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());
×
50
        if (pathElement == 0) {
×
51
            Direction thisSide = getSide();
×
52
            Direction thatSide = o.getSide();
×
53
            // If one of the sides is null, assume equality
54
            return thisSide != null && thatSide != null ? thisSide.compareTo(thatSide) : 0;
×
55
        }
56
        return pathElement;
×
57
    }
58

59
    @Override
60
    public int hashCode() {
61
        return getPathElement().getPosition().hashCode();
×
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);
×
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