Skip to content

Commit e2c4b67

Browse files
committed
more documentation changes
1 parent e957539 commit e2c4b67

File tree

10 files changed

+98
-90
lines changed

10 files changed

+98
-90
lines changed

api/src/main/java/net/megavex/scoreboardlibrary/api/ScoreboardLibrary.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717

1818
/**
1919
* Entrypoint of the library. To create an instance of this interface, use {@link #loadScoreboardLibrary}.
20-
* For unit tests, take a look at {@link NoopScoreboardLibrary}.
20+
* For unit testing, take a look at {@link NoopScoreboardLibrary}.
2121
* Note: this class is thread-safe, meaning you can safely use it from multiple threads at a time.
2222
*/
2323
@ApiStatus.NonExtendable
2424
public interface ScoreboardLibrary {
2525
/**
2626
* Creates an instance of {@link ScoreboardLibrary}.
2727
*
28-
* @param plugin Your plugin instance
28+
* @param plugin your plugin instance
2929
* @throws NoPacketAdapterAvailableException if there is no packet adapter available for the current server version
3030
*/
3131
static @NotNull ScoreboardLibrary loadScoreboardLibrary(@NotNull Plugin plugin) throws NoPacketAdapterAvailableException {
@@ -53,7 +53,7 @@ public interface ScoreboardLibrary {
5353
/**
5454
* Creates a new {@link Sidebar};
5555
*
56-
* @return Newly created sidebar
56+
* @return newly created sidebar
5757
*/
5858
default @NotNull Sidebar createSidebar() {
5959
return createSidebar(Sidebar.MAX_LINES, null);
@@ -62,9 +62,9 @@ public interface ScoreboardLibrary {
6262
/**
6363
* Creates a new {@link Sidebar}.
6464
*
65-
* @param maxLines Max amount of lines the sidebar will have.
65+
* @param maxLines max amount of lines the sidebar will have.
6666
* Note that vanilla clients can only display at most {@value Sidebar#MAX_LINES}
67-
* @return Newly created sidebar
67+
* @return newly created sidebar
6868
*/
6969
default @NotNull Sidebar createSidebar(@Range(from = 1, to = Integer.MAX_VALUE) int maxLines) {
7070
return createSidebar(maxLines, null);
@@ -73,25 +73,25 @@ public interface ScoreboardLibrary {
7373
/**
7474
* Creates a new {@link Sidebar}.
7575
*
76-
* @param maxLines Max amount of lines the sidebar will have.
76+
* @param maxLines max amount of lines the sidebar will have.
7777
* Note that vanilla clients can only display at most {@value Sidebar#MAX_LINES}
78-
* @param locale Locale which will be used for translating {@link net.kyori.adventure.text.TranslatableComponent}s,
78+
* @param locale locale which will be used for translating {@link net.kyori.adventure.text.TranslatableComponent}s,
7979
* or null if the locale should depend on the player
80-
* @return Newly created sidebar
80+
* @return newly created sidebar
8181
*/
8282
@NotNull Sidebar createSidebar(@Range(from = 1, to = Integer.MAX_VALUE) int maxLines, @Nullable Locale locale);
8383

8484
/**
8585
* Creates a new {@link TeamManager}.
8686
*
87-
* @return Newly created team manager
87+
* @return newly created team manager
8888
*/
8989
@NotNull TeamManager createTeamManager();
9090

9191
/**
9292
* Creates a new {@link ObjectiveManager}.
9393
*
94-
* @return Newly created objective manager
94+
* @return newly created objective manager
9595
*/
9696
@NotNull ObjectiveManager createObjectiveManager();
9797

@@ -102,7 +102,7 @@ public interface ScoreboardLibrary {
102102
void close();
103103

104104
/**
105-
* @return Whether this scoreboard library instance is closed
105+
* @return whether this scoreboard library instance is closed
106106
*/
107107
boolean closed();
108108
}

api/src/main/java/net/megavex/scoreboardlibrary/api/objective/ObjectiveManager.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ public interface ObjectiveManager {
1616
/**
1717
* Creates an objective with a name if one doesn't already exist and returns it.
1818
*
19-
* @param name Name of the objective
20-
* @return Objective
19+
* @param name name of the objective
20+
* @return objective
2121
*/
2222
@NotNull ScoreboardObjective create(@NotNull String name);
2323

2424
/**
2525
* Removes an objective.
2626
*
27-
* @param objective Objective to remove
27+
* @param objective objective to remove
2828
*/
2929
void remove(@NotNull ScoreboardObjective objective);
3030

3131
/**
3232
* Updates which objective is shown in a display slot.
3333
*
34-
* @param displaySlot Display slot value to show objective in
35-
* @param objective Objective to display in that display slot
34+
* @param displaySlot display slot value to show objective in
35+
* @param objective objective to display in that display slot
3636
*/
3737
void display(@NotNull ObjectiveDisplaySlot displaySlot, @NotNull ScoreboardObjective objective);
3838

3939
/**
40-
* @return Unmodifiable collection of viewers in this ObjectiveManager
40+
* @return unmodifiable collection of viewers in this ObjectiveManager
4141
* @see #addPlayer
4242
* @see #removePlayer
4343
*/
@@ -49,15 +49,15 @@ public interface ObjectiveManager {
4949
* The ObjectiveManager will internally be added to a queue for this player who
5050
* will start seeing it once they are removed from all previous ObjectiveManagers.
5151
*
52-
* @param player Player to add
53-
* @return Whether the player was added
52+
* @param player player to add
53+
* @return whether the player was added
5454
*/
5555
boolean addPlayer(@NotNull Player player);
5656

5757
/**
5858
* Adds multiple viewers to this ObjectiveManager.
5959
*
60-
* @param players Viewers to add
60+
* @param players viewers to add
6161
* @see #addPlayer
6262
*/
6363
default void addPlayers(@NotNull Collection<Player> players) {
@@ -69,15 +69,15 @@ default void addPlayers(@NotNull Collection<Player> players) {
6969
/**
7070
* Removes a viewer from this ObjectiveManager.
7171
*
72-
* @param player Viewer to remove
73-
* @return Whether the viewer was removed
72+
* @param player viewer to remove
73+
* @return whether the viewer was removed
7474
*/
7575
boolean removePlayer(@NotNull Player player);
7676

7777
/**
7878
* Removes multiple viewers from this ObjectiveManager
7979
*
80-
* @param players Viewers to remove
80+
* @param players viewers to remove
8181
*/
8282
default void removePlayers(@NotNull Collection<Player> players) {
8383
for (Player player : players) {
@@ -92,7 +92,7 @@ default void removePlayers(@NotNull Collection<Player> players) {
9292
void close();
9393

9494
/**
95-
* @return Whether this ObjectiveManager is closed
95+
* @return whether this ObjectiveManager is closed
9696
* @see #close
9797
*/
9898
boolean closed();

api/src/main/java/net/megavex/scoreboardlibrary/api/objective/ScoreboardObjective.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
*/
1414
public interface ScoreboardObjective {
1515
/**
16-
* @return The value (display name) of the objective, defaults to {@link Component#empty}
16+
* @return the value (display name) of the objective, defaults to {@link Component#empty}
1717
*/
1818
@NotNull Component value();
1919

2020
/**
2121
* Sets the value (display name) of the objective.
2222
*
23-
* @param value New value
23+
* @param value new value
2424
*/
2525
@NotNull ScoreboardObjective value(@NotNull ComponentLike value);
2626

2727
/**
28-
* @return The render type of the objective, defaults to {@link ObjectiveRenderType#INTEGER}
28+
* @return the render type of the objective, defaults to {@link ObjectiveRenderType#INTEGER}
2929
*/
3030
@NotNull ObjectiveRenderType renderType();
3131

3232
/**
3333
* Sets the render type of the objective.
3434
*
35-
* @param renderType New render type
35+
* @param renderType new render type
3636
*/
3737
@NotNull ScoreboardObjective renderType(@NotNull ObjectiveRenderType renderType);
3838

@@ -52,16 +52,16 @@ public interface ScoreboardObjective {
5252
/**
5353
* Get the score for an entry, or null if the entry has no score.
5454
*
55-
* @param entry Entry to get score of
56-
* @return The score value, or null if it doesn't exist for the entry
55+
* @param entry entry to get score of
56+
* @return the score value, or null if it doesn't exist for the entry
5757
*/
5858
@Nullable ObjectiveScore scoreInfo(@NotNull String entry);
5959

6060
/**
6161
* Gets the score value for an entry, or null if the entry has no score.
6262
*
63-
* @param entry Entry to get score of
64-
* @return The score value, or null if it doesn't exist for the entry
63+
* @param entry entry to get score of
64+
* @return the score value, or null if it doesn't exist for the entry
6565
* @deprecated use {@link #scoreInfo(String).value()} and {@link ObjectiveScore#value()} instead
6666
*/
6767
@Deprecated
@@ -73,16 +73,16 @@ public interface ScoreboardObjective {
7373
/**
7474
* Updates the score of an entry.
7575
*
76-
* @param entry Entry to update score of
77-
* @param score Score
76+
* @param entry entry to update score of
77+
* @param score score
7878
*/
7979
@NotNull ScoreboardObjective score(@NotNull String entry, ObjectiveScore score);
8080

8181
/**
8282
* Updates the score of an entry.
8383
*
84-
* @param entry Entry to update score of
85-
* @param scoreValue Score value
84+
* @param entry entry to update score of
85+
* @param scoreValue score value
8686
*/
8787
default @NotNull ScoreboardObjective score(@NotNull String entry, int scoreValue) {
8888
return score(entry, new ObjectiveScore(scoreValue, null, null));
@@ -138,7 +138,7 @@ public interface ScoreboardObjective {
138138
/**
139139
* Removes a score associated with an entry.
140140
*
141-
* @param entry Entry to remove score of
141+
* @param entry entry to remove score of
142142
*/
143143
@NotNull ScoreboardObjective removeScore(@NotNull String entry);
144144
}

api/src/main/java/net/megavex/scoreboardlibrary/api/sidebar/Sidebar.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public interface Sidebar {
2929
// Main
3030

3131
/**
32-
* @return Max amount of lines this sidebar can have
32+
* @return max amount of lines this sidebar can have
3333
*/
3434
@Range(from = 1, to = Integer.MAX_VALUE) int maxLines();
3535

3636
/**
37-
* @return Locale which is used for translating {@link net.kyori.adventure.text.TranslatableComponent}s,
37+
* @return locale which is used for translating {@link net.kyori.adventure.text.TranslatableComponent}s,
3838
* or null if it depends on each player's client locale.
3939
* @see ScoreboardLibrary#createSidebar(int, Locale)
4040
*/
@@ -45,16 +45,16 @@ public interface Sidebar {
4545
/**
4646
* Gets a line's value.
4747
*
48-
* @param line Line index
49-
* @return Value of line, or null if unset
48+
* @param line line index
49+
* @return value of line, or null if unset
5050
*/
5151
@Nullable Component line(@Range(from = 0, to = Integer.MAX_VALUE - 1) int line);
5252

5353
/**
5454
* Sets a line's value.
5555
*
56-
* @param index Line index
57-
* @param value New value, or null to hide
56+
* @param index line index
57+
* @param value new value, or null to hide
5858
*/
5959
default void line(@Range(from = 0, to = Integer.MAX_VALUE - 1) int index, @Nullable ComponentLike value) {
6060
line(index, value, null);
@@ -64,9 +64,9 @@ default void line(@Range(from = 0, to = Integer.MAX_VALUE - 1) int index, @Nulla
6464
* Sets a line's value with a custom score format.
6565
* Note that custom score formats are only supported in Minecraft 1.20.3+.
6666
*
67-
* @param index Line index
68-
* @param value New value, or null to hide
69-
* @param scoreFormat Score format
67+
* @param index line index
68+
* @param value new value, or null to hide
69+
* @param scoreFormat score format
7070
*/
7171
void line(
7272
@Range(from = 0, to = Integer.MAX_VALUE - 1) int index,
@@ -86,21 +86,21 @@ default void clearLines() {
8686
// Title
8787

8888
/**
89-
* @return Title of the sidebar, defaults to {@link Component#empty}
89+
* @return title of the sidebar, defaults to {@link Component#empty}
9090
*/
9191
@NotNull Component title();
9292

9393
/**
9494
* Sets the title of the sidebar.
9595
*
96-
* @param title Title
96+
* @param title title
9797
*/
9898
void title(@NotNull ComponentLike title);
9999

100100
// Players
101101

102102
/**
103-
* @return Unmodifiable collection of viewers in this Sidebar
103+
* @return unmodifiable collection of viewers in this Sidebar
104104
* @see #addPlayer
105105
* @see #removePlayer
106106
*/
@@ -112,15 +112,15 @@ default void clearLines() {
112112
* The Sidebar will internally be added to a queue for this player who
113113
* will start seeing it once they are removed from all previous Sidebars.
114114
*
115-
* @param player Player to add
116-
* @return Whether the player was added
115+
* @param player player to add
116+
* @return whether the player was added
117117
*/
118118
boolean addPlayer(@NotNull Player player);
119119

120120
/**
121121
* Adds multiple viewers to this Sidebar.
122122
*
123-
* @param players Viewers to add
123+
* @param players viewers to add
124124
* @see #addPlayer
125125
*/
126126
default void addPlayers(@NotNull Collection<Player> players) {
@@ -132,15 +132,15 @@ default void addPlayers(@NotNull Collection<Player> players) {
132132
/**
133133
* Removes a viewer from this Sidebar.
134134
*
135-
* @param player Viewer to remove
136-
* @return Whether the viewer was removed
135+
* @param player viewer to remove
136+
* @return whether the viewer was removed
137137
*/
138138
boolean removePlayer(@NotNull Player player);
139139

140140
/**
141141
* Removes multiple viewers from this Sidebar
142142
*
143-
* @param players Viewers to remove
143+
* @param players viewers to remove
144144
*/
145145
default void removePlayers(@NotNull Collection<Player> players) {
146146
for (Player player : players) {

api/src/main/java/net/megavex/scoreboardlibrary/api/sidebar/component/ComponentSidebarLayout.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
import static net.kyori.adventure.text.Component.empty;
1212

13+
/**
14+
* Represents a component sidebar layout that can be applied to a {@link Sidebar}.
15+
*/
1316
public final class ComponentSidebarLayout {
1417
private final SidebarComponent titleComponent;
1518
private final SidebarComponent linesComponent;

api/src/main/java/net/megavex/scoreboardlibrary/api/sidebar/component/animation/CollectionSidebarAnimation.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
import java.util.Collection;
99
import java.util.List;
1010

11+
/**
12+
* Implementation of {@link FramedSidebarAnimation} using a predefined collection of frames.
13+
*
14+
* @param <T> frame type
15+
*/
1116
public final class CollectionSidebarAnimation<T> implements FramedSidebarAnimation<T> {
1217
private final List<T> frames;
1318
private int currentFrameIndex;

0 commit comments

Comments
 (0)