Skip to content

Commit

Permalink
feat(api): add Element.Builder#from(float, float, float) and Element.…
Browse files Browse the repository at this point in the history
…Builder#to(float, float, float) shortcut methods
  • Loading branch information
yusshu committed Dec 4, 2023
1 parent b96aa1e commit e0367bb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions api/src/main/java/team/unnamed/creative/model/Element.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ interface Builder {
@Contract("_ -> this")
@NotNull Builder from(final @NotNull Vector3Float from);

/**
* Sets the starting point of the element cuboid.
*
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @return This builder
* @since 1.5.0
*/
@Contract("_, _, _ -> this")
default @NotNull Builder from(final float x, final float y, final float z) {
return from(new Vector3Float(x, y, z));
}

/**
* Sets the stop point of the element cuboid.
*
Expand All @@ -145,6 +159,19 @@ interface Builder {
@Contract("_ -> this")
@NotNull Builder to(final @NotNull Vector3Float to);

/**
* Sets the stop point of the element cuboid.
*
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @return This builder
* @since 1.5.0
*/
default @NotNull Builder to(final float x, final float y, final float z) {
return to(new Vector3Float(x, y, z));
}

/**
* Sets the element rotation.
*
Expand Down

0 comments on commit e0367bb

Please sign in to comment.