本文整理了Java中net.minecraft.util.EnumFacing.compareTo()
方法的一些代码示例,展示了EnumFacing.compareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EnumFacing.compareTo()
方法的具体详情如下:
包路径:net.minecraft.util.EnumFacing
类名称:EnumFacing
方法名:compareTo
暂无
代码示例来源:origin: McJtyMods/XNet
@Override
public int compareTo(SidedPos o) {
int result = pos.compareTo(o.pos);
if(result == 0) result = side.compareTo(o.side);
return result;
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public int compareTo(IOMode o) {
int d = direction.compareTo(o.direction);
if (d != 0) {
return d;
}
return iomode.ordinal() < o.iomode.ordinal() ? -1 : iomode.ordinal() > o.iomode.ordinal() ? 1 : 0;
}
代码示例来源:origin: CyclopsMC/IntegratedDynamics
@Override
public int compareTo(PartPos o) {
int pos = this.getPos().compareTo(o.getPos());
if (pos == 0) {
EnumFacing thisSide = this.getSide();
EnumFacing thatSide = o.getSide();
return thisSide == null ? (thatSide == null ? 0 : -1) : (thatSide == null ? 1 : thisSide.compareTo(thatSide));
}
return pos;
}
}
代码示例来源:origin: CyclopsMC/IntegratedDynamics
@Override
public int compareTo(INetworkElement o) {
if(o instanceof IPartNetworkElement) {
IPartNetworkElement p = (IPartNetworkElement) o;
int compClass = this.getPart().getClass().getCanonicalName().compareTo(p.getPart().getClass().getCanonicalName());
if (compClass == 0) {
// If this or the other part is not loaded, we IGNORE the priority,
// because that depends on tile entity data, which requires loading the part/chunk.
int compPriority = !isLoaded() || !p.isLoaded() ? 0 : -Integer.compare(this.getPriority(), p.getPriority());
if (compPriority == 0) {
int compPart = getPart().getUnlocalizedName().compareTo(p.getPart().getUnlocalizedName());
if (compPart == 0) {
int compPos = getCenterPos(getTarget()).compareTo(getCenterPos(p.getTarget()));
if (compPos == 0) {
return getCenterSide(getTarget()).compareTo(getCenterSide(p.getTarget()));
}
return compPos;
}
return compPart;
} else {
return compPriority;
}
} else {
return compClass;
}
}
return this.getClass().getCanonicalName().compareTo(o.getClass().getCanonicalName());
}
代码示例来源:origin: CyclopsMC/IntegratedDynamics
@Override
public int compareTo(ISidedPathElement o) {
int pathElement = getPathElement().getPosition().compareTo(o.getPathElement().getPosition());
if (pathElement == 0) {
EnumFacing thisSide = getSide();
EnumFacing thatSide = o.getSide();
// If one of the sides is null, assume equality
return thisSide != null && thatSide != null ? thisSide.compareTo(thatSide) : 0;
}
return pathElement;
}
代码示例来源:origin: CyclopsMC/IntegratedDynamics
@Override
public int compareTo(PrioritizedPartPos o) {
int compPriority = -Integer.compare(this.getPriority(), o.getPriority());
if (compPriority == 0) {
int compPos = this.getPartPos().getPos().compareTo(o.getPartPos().getPos());
if (compPos == 0) {
EnumFacing thisSide = this.getPartPos().getSide();
EnumFacing otherSide = o.getPartPos().getSide();
return thisSide == null ? -1 : (otherSide == null ? 1 : thisSide.compareTo(otherSide));
}
return compPos;
}
return compPriority;
}
内容来源于网络,如有侵权,请联系作者删除!