Skip to content

Commit f424559

Browse files
committed
Expose tab list entry order
1 parent c0f65a1 commit f424559

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/main/java/org/spongepowered/api/entity/living/player/tab/TabListEntry.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,25 @@ static Builder builder() {
167167
*/
168168
TabListEntry setListed(boolean listed);
169169

170+
/**
171+
* Gets the weight of this entry.
172+
* Entries are first sorted by their weight in
173+
* descending order.
174+
*
175+
* @return The weight of this entry
176+
*/
177+
int weight();
178+
179+
/**
180+
* Sets the weight of this entry.
181+
* Entries are first sorted by their weight in
182+
* descending order.
183+
*
184+
* @param weight The new weight
185+
* @return This entry, for chaining
186+
*/
187+
TabListEntry setWeight(int weight);
188+
170189
/**
171190
* Represents a builder class to create mutable {@link TabListEntry}s.
172191
*
@@ -230,6 +249,15 @@ interface Builder extends org.spongepowered.api.util.Builder<TabListEntry, Build
230249
*/
231250
Builder listed(boolean listed);
232251

252+
/**
253+
* Sets the weight for entries created by this builder.
254+
*
255+
* @param weight The weight
256+
* @return The builder
257+
* @see TabListEntry#setWeight(int)
258+
*/
259+
Builder weight(int weight);
260+
233261
/**
234262
* Builds an entry based off the values of this builder.
235263
*

0 commit comments

Comments
 (0)