Skip to content

Commit

Permalink
Expose tab list entry order
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Dec 22, 2024
1 parent c0f65a1 commit f424559
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,25 @@ static Builder builder() {
*/
TabListEntry setListed(boolean listed);

/**
* Gets the weight of this entry.
* Entries are first sorted by their weight in
* descending order.
*
* @return The weight of this entry
*/
int weight();

/**
* Sets the weight of this entry.
* Entries are first sorted by their weight in
* descending order.
*
* @param weight The new weight
* @return This entry, for chaining
*/
TabListEntry setWeight(int weight);

/**
* Represents a builder class to create mutable {@link TabListEntry}s.
*
Expand Down Expand Up @@ -230,6 +249,15 @@ interface Builder extends org.spongepowered.api.util.Builder<TabListEntry, Build
*/
Builder listed(boolean listed);

/**
* Sets the weight for entries created by this builder.
*
* @param weight The weight
* @return The builder
* @see TabListEntry#setWeight(int)
*/
Builder weight(int weight);

/**
* Builds an entry based off the values of this builder.
*
Expand Down

0 comments on commit f424559

Please sign in to comment.