return getRenderCap() - 1;
}
@Override
protected void renderLines(MinecraftAccess mc, boolean isSecondary) {
final ReadonlyLineStyle fromStyle = getEffectiveLineStyle();
final ReadonlyLineStyle toStyle = getBlendToLineStyle();
if (toStyle == null || getBlendEndpoint() <= 0) {
super.renderLines(mc, isSecondary);
return;
}
if (isSecondary && !toStyle.hasSecondaryColor()) {
super.renderLines(mc, isSecondary);
return;
}
final int renderCap = getRenderCap();
final Iterator<ReadonlyVector3> it = getPoints().iterator();
if (renderCap == 0 || !it.hasNext()) {
return;
}
final ReadonlyColor fromColor;
final ReadonlyColor toColor;
final float fromWidth;
final float toWidth;
// we've already checked for all null cases earlier
if (isSecondary) {
fromColor = fromStyle.getSecondaryReadonlyColor();
toColor = toStyle.getSecondaryReadonlyColor();
fromWidth = fromStyle.getSecondaryWidth();
toWidth = toStyle.getSecondaryWidth();
} else {
fromColor = fromStyle.getMainReadonlyColor();
toColor = toStyle.getMainReadonlyColor();
fromWidth = fromStyle.getMainWidth();
toWidth = toStyle.getMainWidth();
}
final float blendEndpoint = getBlendEndpoint();
// We can't use GL_LINE_STRIP in a single drawing session because each
// line segment has its own style.