package mcjty.xnet.api.keys;

import mcjty.lib.varia.BlockPosTools;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;

import javax.annotation.Nonnull;

public class SidedPos {
    private final BlockPos pos;
    private final EnumFacing side;

    /**
     * A position of a connected block and the side relative
     * from this block where the connection is. Basically
     * pos.offset(side) will be the consumer/connector
     */
    public SidedPos(@Nonnull BlockPos pos, @Nonnull EnumFacing side) {
        this.pos = pos;
        this.side = side;
    }

    @Nonnull
    public BlockPos getPos() {
        return pos;
    }

    /**
     * Get the side relative to this position for the connector.
     */
    @Nonnull
    public EnumFacing getSide() {
        return side;
    }

    @Override
    public String toString() {
        return "SidedPos{" + BlockPosTools.toString(pos) + "/" + side.getName() + "}";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SidedPos sidedPos = (SidedPos) o;

        return side == sidedPos.side && pos.equals(sidedPos.pos);
    }

    @Override
    public int hashCode() {
        return 31 * pos.hashCode() + side.hashCode();
    }
}

@@ -196,16 +196,48 @@
 SidedPos
+ implements Comparable%3CSidedPos%3E
  %7B%0A    p
@@ -1356,11 +1356,194 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public int compareTo(SidedPos o) %7B%0A        int result = pos.compareTo(o.pos);%0A        if(result == 0) result = side.compareTo(o.side);%0A        return result;%0A    %7D
 %0A%7D%0A

Make SidedPos implement Comparable