• 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/api/part/PrioritizedPartPos.java
1
package org.cyclops.integrateddynamics.api.part;
2

3
import net.minecraft.core.Direction;
4

5
/**
6
 * A wrapper around {@link PartPos} that also holds a priority.
7
 *
8
 * This is useful for automatically providing sorted collections.
9
 *
10
 * @author rubensworks
11
 */
12
public class PrioritizedPartPos implements Comparable<PrioritizedPartPos> {
13
    private final PartPos partPos;
14
    private final int priority;
15

16
    private PrioritizedPartPos(PartPos partPos, int priority) {
×
17
        this.partPos = partPos;
×
18
        this.priority = priority;
×
19
    }
×
20

21
    @Override
22
    public int compareTo(PrioritizedPartPos o) {
23
        int compPriority = -Integer.compare(this.getPriority(), o.getPriority());
×
24
        if (compPriority == 0) {
×
25
            int compPos = this.getPartPos().getPos().compareTo(o.getPartPos().getPos());
×
26
            if (compPos == 0) {
×
27
                Direction thisSide = this.getPartPos().getSide();
×
28
                Direction otherSide = o.getPartPos().getSide();
×
29
                return thisSide == null ? (otherSide == null ? 0 : -1) : (otherSide == null ? 1 : thisSide.compareTo(otherSide));
×
30
            }
31
            return compPos;
×
32
        }
33
        return compPriority;
×
34
    }
35

36
    public static PrioritizedPartPos of(PartPos pos, int priority) {
37
        return new PrioritizedPartPos(pos, priority);
×
38
    }
39

40
    public PartPos getPartPos() {
41
        return partPos;
×
42
    }
43

44
    public int getPriority() {
45
        return priority;
×
46
    }
47

48
    @Override
49
    public boolean equals(Object obj) {
50
        return obj instanceof PrioritizedPartPos && compareTo((PrioritizedPartPos) obj) == 0;
×
51
    }
52

53
    @Override
54
    public int hashCode() {
55
        return getPartPos().hashCode() + getPriority() << 1;
×
56
    }
57
}
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