Skip to content

Commit

Permalink
Make old Waypoint constructor deprecated and fix javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
WalshyDev committed Jan 2, 2024
1 parent 12a7f55 commit 33fae27
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ public class Waypoint {
private final String name;
private final Location location;

/**
* This constructs a new {@link Waypoint} object.
*
* @param profile
* The owning {@link PlayerProfile}
* @param id
* The unique id for this {@link Waypoint}
* @param loc
* The {@link Location} of the {@link Waypoint}
* @param name
* The name of this {@link Waypoint}
*
* @deprecated Use {@link #Waypoint(UUID, String, Location, String)} instead
*/
@Deprecated
@ParametersAreNonnullByDefault
public Waypoint(PlayerProfile profile, String id, Location loc, String name) {
this(profile.getUUID(), id, loc, name);
}

/**
* This constructs a new {@link Waypoint} object.
*
Expand Down Expand Up @@ -77,7 +97,7 @@ public UUID getOwnerId() {
*
* @return The corresponding {@link PlayerProfile}
*
* @deprecated Use {@link #getUuid()} instead
* @deprecated Use {@link #getOwnerId()} instead
*/
@Nonnull
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1160,11 +1160,11 @@ public final int hashCode() {
}

/**
* Retrieve a {@link Optional}<{@link SlimefunItem}> by its id.
* Retrieve a {@link Optional} {@link SlimefunItem} by its id.
*
* @param id
* The id of the {@link SlimefunItem}
* @return The {@link Optional}<{@link SlimefunItem}> associated with that id. Empty if non-existent
* @return The {@link Optional} {@link SlimefunItem} associated with that id. Empty if non-existent
*/
public static @Nonnull Optional<SlimefunItem> getOptionalById(@Nonnull String id) {
return Optional.ofNullable(getById(id));
Expand Down Expand Up @@ -1193,11 +1193,11 @@ public final int hashCode() {
}

/**
* Retrieve a {@link Optional}<{@link SlimefunItem}> from an {@link ItemStack}.
* Retrieve a {@link Optional} {@link SlimefunItem} from an {@link ItemStack}.
*
* @param item
* The {@link ItemStack} to check
* @return The {@link Optional}<{@link SlimefunItem}> associated with this {@link ItemStack} if present, otherwise empty
* @return The {@link Optional} {@link SlimefunItem} associated with this {@link ItemStack} if present, otherwise empty
*/
public @Nonnull Optional<SlimefunItem> getOptionalByItem(@Nullable ItemStack item) {
return Optional.ofNullable(getByItem(item));
Expand Down

0 comments on commit 33fae27

Please sign in to comment.