/** * Moves chunk coordinates a number of steps in the given direction. Returns * nothing if the new coordinates are not valid. * {@link Division#SECONDARY_ORDINAL} directions are not a valid * argument. These will throw an exception. * * @param chunkCoords The chunk coordinates to move from * @param direction The direction in which to move * @param steps The number of steps to take * @return The new chunk coordinates if they are valid * @throws IllegalArgumentException If the direction is a * {@link Division#SECONDARY_ORDINAL} */ default Optional<Vector3i> moveToChunk(Vector3i chunkCoords, Direction direction, int steps) { checkNotNull(direction, "direction"); checkArgument(!direction.isSecondaryOrdinal(), "Secondary cardinal directions can't be used here"); return addToChunk(chunkCoords, direction.asBlockOffset().mul(steps)); }
@Override public Vector3i mul(int a) { return mul(a, a, a); }
@Override public Vector3i mul(int a) { return mul(a, a, a); }
public Vector3i mul(Vector3i v) { return mul(v.x, v.y, v.z); }
public Vector3i mul(Vector3i v) { return mul(v.x, v.y, v.z); }
public Vector3i mul(double a) { return mul(GenericMath.floor(a)); }
public Vector3i mul(double a) { return mul(GenericMath.floor(a)); }
/** * Moves chunk coordinates a number of steps in the given direction. Returns * nothing if the new coordinates are not valid. * {@link Division#SECONDARY_ORDINAL} directions are not a valid * argument. These will throw an exception. * * @param chunkCoords The chunk coordinates to move from * @param direction The direction in which to move * @param steps The number of steps to take * @return The new chunk coordinates if they are valid * @throws IllegalArgumentException If the direction is a * {@link Division#SECONDARY_ORDINAL} */ default Optional<Vector3i> moveToChunk(Vector3i chunkCoords, Direction direction, int steps) { checkNotNull(direction, "direction"); checkArgument(!direction.isSecondaryOrdinal(), "Secondary cardinal directions can't be used here"); return addToChunk(chunkCoords, direction.asBlockOffset().mul(steps)); }
public Vector3i mul(double x, double y, double z) { return mul(GenericMath.floor(x), GenericMath.floor(y), GenericMath.floor(z)); }
public Vector3i mul(double x, double y, double z) { return mul(GenericMath.floor(x), GenericMath.floor(y), GenericMath.floor(z)); }