Skip to content

Commit c3c8524

Browse files
authored
docs: add missing p tags and rework existing tag for consistency (#2449)
add implNote when the comment is an implementation detail remove ignored newlines
1 parent 1b6c377 commit c3c8524

25 files changed

+94
-127
lines changed

src/main/java/org/spongepowered/api/Client.java

+4-13
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ public interface Client extends Engine, LocaleSource {
4242
* Gets the {@link ClientPlayer player} responsible
4343
* for controlling this client.
4444
*
45-
* <p>
46-
* A client may not always have a local player if browsing menus prior to joining a
47-
* world or server.
48-
* </p>
49-
*
45+
* @implNote A client may not always have a local player if browsing menus prior to joining a
46+
* world or server.
5047
* @return The local player or {@link Optional#empty()} if it is not found
5148
*/
5249
Optional<LocalPlayer> player();
@@ -55,10 +52,7 @@ public interface Client extends Engine, LocaleSource {
5552
* Gets the {@link LocalServer server} that powers a local SinglePlayer game instance
5653
* of a typical Minecraft client.
5754
*
58-
* <p>
59-
* A client will not have a local server if it is outside of SinglePlayer
60-
* </p>
61-
*
55+
* @implNote A client will not have a local server if it is outside of SinglePlayer
6256
* @return The local server or {@link Optional#empty()} if it is not found
6357
*/
6458
Optional<LocalServer> server();
@@ -67,10 +61,7 @@ public interface Client extends Engine, LocaleSource {
6761
* Gets the {@link ClientWorld world} that a typical Minecraft client will be viewing
6862
* while in some game instance (local or remote).
6963
*
70-
* <p>
71-
* A client will not have a client world if it is browsing the main menus
72-
* </p>
73-
*
64+
* @implNote A client will not have a client world if it is browsing the main menus
7465
* @return The client world or {@link Optional#empty()}} if it is not found
7566
*/
7667
Optional<ClientWorld> world();

src/main/java/org/spongepowered/api/Engine.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ public interface Engine extends RegistryHolder {
8282
/**
8383
* Rediscovers all {@link Resource resources} within all {@link Pack pack's} {@link PackContents contents}.
8484
*
85-
* <p>On the server, the future will always be completed.</p>
86-
*
85+
* @implNote On the server, the future will always be completed.
8786
* @return A future that completes when reloading is complete
8887
*/
8988
CompletableFuture<Void> reloadResources();

src/main/java/org/spongepowered/api/Game.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,9 @@ default Client client() {
195195
* services that plugins may provide. Services provided here are
196196
* scoped to the lifetime of the Game.
197197
*
198-
* <p>The provider will not be available during plugin construction and will
198+
* @implNote The provider will not be available during plugin construction and will
199199
* throw an {@link IllegalStateException} if there is an attempt to access
200-
* this before the provider is ready.</p>
201-
*
200+
* this before the provider is ready.
202201
* @return The service manager
203202
*/
204203
ServiceProvider.GameScoped serviceProvider();

src/main/java/org/spongepowered/api/MinecraftVersion.java

+3-11
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ public interface MinecraftVersion extends Comparable<MinecraftVersion> {
3737
/**
3838
* Gets the name of this Minecraft version.
3939
*
40-
* <p>
41-
* <strong>Note:</strong> The returned name does not necessarily represent
40+
* @implNote The returned name does not necessarily represent
4241
* the name of a Minecraft version. Depending on the client and
4342
* implementation, this may also just return a numeric value.
44-
* </p>
45-
*
4643
* @return The version name
4744
*/
4845
String name();
@@ -52,21 +49,16 @@ public interface MinecraftVersion extends Comparable<MinecraftVersion> {
5249
* all of the features in {@link StatusResponse}. These versions are only
5350
* supported for the {@link ClientPingServerEvent}, normally they should not be
5451
* able to join the server.
55-
* <p>
56-
* For Vanilla, this returns {@code true} for all clients older than 1.7.
57-
* </p>
5852
*
53+
* @implNote For Vanilla, this returns {@code true} for all clients older than 1.7.
5954
* @return {@code True} if this version is a legacy version
6055
*/
6156
boolean isLegacy();
6257

6358
/**
6459
* Gets the data version of this Minecraft version.
6560
*
66-
* <p>
67-
* <strong>Note:</strong> The data version will not be available in a status response.
68-
* </p>
69-
*
61+
* @implNote The data version will not be available in a status response.
7062
* @return The data version
7163
*/
7264
OptionalInt dataVersion();

src/main/java/org/spongepowered/api/Platform.java

+9-12
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ public interface Platform {
4646
/**
4747
* Retrieves the current {@link Type} the platform is executing on.
4848
*
49-
* <p>A Minecraft instance will have a client and server thread. If the
49+
* @implNote A Minecraft instance will have a client and server thread. If the
5050
* server is executing, this will return {@linkplain Type#SERVER} but
51-
* {@link Platform#type()} would return {@linkplain Type#CLIENT}.</p>
52-
*
51+
* {@link Platform#type()} would return {@linkplain Type#CLIENT}.
5352
* @return The execution type
5453
*/
5554
Type executionType();
@@ -72,25 +71,23 @@ public interface Platform {
7271

7372
/**
7473
* Returns this platform instance, as a key-value map.
74+
* <p>
75+
* This mechanism allows for platform-specific information like Forge
76+
* version.
7577
*
76-
* <p>The returned map instance is connected directly to this platform
78+
* @implNote The returned map instance is connected directly to this platform
7779
* instance. Existing keys like name and version are not modifiable, but
7880
* new keys are stored in this instance and are shared between any
79-
* references to a map obtained through the retrieved map.</p>
80-
*
81-
* <p>This mechanism allows for platform-specific information like Forge
82-
* version.</p>
83-
*
81+
* references to a map obtained through the retrieved map.
8482
* @return This platform as a map
8583
*/
8684
Map<String, Object> asMap();
8785

8886
/**
8987
* The type of the platform, or where the game is currently running.
90-
*
91-
* <p>A side is what part of Minecraft this is being run on. The client, or
88+
* <p>
89+
* A side is what part of Minecraft this is being run on. The client, or
9290
* the server. The internal server is also treated like a dedicated server.
93-
* </p>
9491
*/
9592
enum Type {
9693

src/main/java/org/spongepowered/api/ResourceKey.java

+9-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
/**
3838
* An object representation of a location or pointer to resources.
3939
* The key can be represented as a {@link String} by {@link Object#toString()}.
40-
*
40+
* <p>
4141
* The key is built with two parts:
4242
* <ol>
4343
* <li>The Namespace</li>
@@ -134,9 +134,8 @@ static ResourceKey of(final PluginContainer plugin, final String value) {
134134
/**
135135
* Resolves a resource key from a string.
136136
*
137-
* <p>If no namespace is found in {@code formatted} then
138-
* {@link #MINECRAFT_NAMESPACE} will be the namespace.</p>
139-
*
137+
* @implNote If no namespace is found in {@code formatted} then
138+
* {@link #MINECRAFT_NAMESPACE} will be the namespace.
140139
* @param formatted The formatted string to parse
141140
* @return A new resource key
142141
*/
@@ -146,10 +145,10 @@ static ResourceKey resolve(final String formatted) {
146145

147146
/**
148147
* Gets this key as a formatted value.
149-
*
150-
* <p>It is up to the implementation to determine the formatting. In
148+
* <p>
149+
* It is up to the implementation to determine the formatting. In
151150
* vanilla Minecraft, keys are formatted as "namespace:value". For example,
152-
* "minecraft:carrot".</p>
151+
* "minecraft:carrot".
153152
*
154153
* @return The key, formatted
155154
*/
@@ -174,11 +173,11 @@ interface Builder extends org.spongepowered.api.util.Builder<ResourceKey, Builde
174173

175174
/**
176175
* Sets the key's namespace.
177-
*
178-
* <p>If using a {@link #MINECRAFT_NAMESPACE} or
176+
* <p>
177+
* If using a {@link #MINECRAFT_NAMESPACE} or
179178
* {@link #SPONGE_NAMESPACE}, it is preferable to use
180179
* {@link ResourceKey#minecraft(String)} or
181-
* {@link ResourceKey#sponge(String)} instead.</p>
180+
* {@link ResourceKey#sponge(String)} instead.
182181
*
183182
* @param namespace The namespace to use
184183
* @return This builder, for chaining

src/main/java/org/spongepowered/api/Server.java

+28-35
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
8787
/**
8888
* Gets if multiple {@link ServerWorld worlds} will be loaded by the server.
8989
*
90-
* <p>If false, no calls to loading worlds via the {@link WorldManager world manager} or otherwise will
91-
* load a world</p>
92-
*
90+
* @implNote If false, no calls to loading worlds via the {@link WorldManager world manager} or otherwise will
91+
* load a world
9392
* @return True if enabled, false if not
9493
*/
9594
boolean isMultiWorldEnabled();
@@ -140,8 +139,7 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
140139
/**
141140
* Gets the player idle timeout, in minutes.
142141
*
143-
* <p>A value of {@code 0} means the timeout is disabled</p>
144-
*
142+
* @implNote A value of {@code 0} means the timeout is disabled
145143
* @return The player idle timeout
146144
*/
147145
int playerIdleTimeout();
@@ -169,7 +167,7 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
169167

170168
/**
171169
* Gets if {@link ServerPlayer players} will have their {@link GameMode game mode} set to the default.
172-
*
170+
* <p>
173171
* {@link Server#gameMode()}
174172
*
175173
* @return True if enforced, false if not
@@ -244,12 +242,11 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
244242

245243
/**
246244
* Gets a {@link ServerPlayer} by their name.
245+
* <p>
246+
* This only works for online players.
247247
*
248-
* <p>This only works for online players.</p>
249-
*
250-
* <p><b>Note: Do not use names for persistent storage, the
251-
* Notch of today may not be the Notch of yesterday.</b></p>
252-
*
248+
* @implNote Do not use names for persistent storage, the
249+
* Notch of today may not be the Notch of yesterday.
253250
* @param name The name to get the player from
254251
* @return The {@link ServerPlayer} or empty if not found
255252
*/
@@ -258,14 +255,13 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
258255
/**
259256
* Gets the 'server' scoreboard. In Vanilla, this is the scoreboard of
260257
* dimension 0 (the overworld).
258+
* <p>
259+
* The server scoreboard is used with the Vanilla /scoreboard command,
260+
* automatic score updating through criteria, and other things.
261261
*
262-
* <p>The server scoreboard is used with the Vanilla /scoreboard command,
263-
* automatic score updating through criteria, and other things.</p>
264-
*
265-
* <p>The server scoreboard may not be available if dimension 0
262+
* @implNote The server scoreboard may not be available if dimension 0
266263
* is not yet loaded. In Vanilla, this will only occur when the
267-
* server is first starting, as dimension 0 is normally always loaded.</p>
268-
*
264+
* server is first starting, as dimension 0 is normally always loaded.
269265
* @return the server scoreboard, if available.
270266
*/
271267
Optional<? extends Scoreboard> serverScoreboard();
@@ -282,9 +278,8 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
282278
* Gets the time, in ticks, since this server began running for the current
283279
* session.
284280
*
285-
* <p>This value is not persisted across server restarts, it is set to zero
286-
* each time the server starts.</p>
287-
*
281+
* @implNote This value is not persisted across server restarts, it is set to zero
282+
* each time the server starts.
288283
* @return The number of ticks since this server started running
289284
*/
290285
Ticks runningTimeTicks();
@@ -322,8 +317,8 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
322317
* Shuts down the server, and kicks all players with the default kick
323318
* message.
324319
*
325-
* <p>For the Sponge implementation on the client, this will trigger the
326-
* Integrated Server to shutdown a tick later.</p>
320+
* @implNote For the Sponge implementation on the client, this will trigger the
321+
* Integrated Server to shutdown a tick later.
327322
*/
328323
void shutdown();
329324

@@ -358,8 +353,8 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
358353

359354
/**
360355
* Gets the target ticks per second for this server.
361-
*
362-
* <p>This is dependent on the implementation.</p>
356+
* <p>
357+
* This is dependent on the implementation.
363358
*
364359
* @return The target tick per second rate.
365360
*/
@@ -368,8 +363,7 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
368363
/**
369364
* Sets the player idle timeout, in minutes.
370365
*
371-
* <p>A value of {@code 0} disables the player idle timeout.</p>
372-
*
366+
* @implNote A value of {@code 0} disables the player idle timeout.
373367
* @param timeout The player idle timeout
374368
*/
375369
void setPlayerIdleTimeout(int timeout);
@@ -379,29 +373,28 @@ public interface Server extends ForwardingAudience, Engine, LocaleSource {
379373
* services that plugins may provide. Services provided here are
380374
* scoped to the lifetime of this Server.
381375
*
382-
* <p>The provider will not be available during plugin construction and will
376+
* @implNote The provider will not be available during plugin construction and will
383377
* throw an {@link IllegalStateException} if there is an attempt to access
384-
* this before the provider is ready.</p>
385-
*
378+
* this before the provider is ready.
386379
* @return The service manager
387380
*/
388381
ServiceProvider.ServerScoped serviceProvider();
389382

390383
/**
391384
* Gets the {@link CommandManager} for executing and inspecting commands.
392-
*
393-
* <p>Commands must be registered by listening to the
394-
* {@link RegisterCommandEvent} instead.</p>
385+
* <p>
386+
* Commands must be registered by listening to the
387+
* {@link RegisterCommandEvent} instead.
395388
*
396389
* @return The {@link CommandManager} instance.
397390
*/
398391
CommandManager commandManager();
399392

400393
/**
401394
* Gets the map storage for this server
402-
*
403-
* <p>This allows for control over the server's maps,
404-
* including obtaining and creating them</p>
395+
* <p>
396+
* This allows for control over the server's maps,
397+
* including obtaining and creating them
405398
*
406399
* @return MapStorage
407400
*/

src/main/java/org/spongepowered/api/Sponge.java

+7-9
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,9 @@ public static boolean isServerAvailable() {
128128
/**
129129
* Gets the {@link Server} instance from the {@link Game} instance.
130130
*
131-
* <p>Note: During various {@link LifecycleEvent events}, a {@link Server} instance
131+
* @implNote During various {@link LifecycleEvent events}, a {@link Server} instance
132132
* may <strong>NOT</strong> be available. Calling {@link Game#server()} during one
133-
* will throw an exception. To double check, call {@link #isServerAvailable()}</p>
134-
*
133+
* will throw an exception. To double check, call {@link #isServerAvailable()}
135134
* @see Game#server()
136135
* @see Game#isServerAvailable()
137136
* @return The server instance
@@ -154,9 +153,8 @@ public static boolean isClientAvailable() {
154153
/**
155154
* Gets the {@link Client} instance from the {@link Game} instance.
156155
*
157-
* <p>Note: Not all implementations support a client, consult your
158-
* vendor for further information.</p>
159-
*
156+
* @implNote Not all implementations support a client, consult your
157+
* vendor for further information.
160158
* @see Game#client()
161159
* @see Game#isClientAvailable()
162160
* @return The client instance
@@ -207,9 +205,9 @@ public static SqlManager sqlManager() {
207205
/**
208206
* Gets the {@link Game} scoped {@link ServiceProvider} for providing
209207
* services.
210-
*
211-
* <p>{@link Engine} scoped services, if they exist, can be found on the
212-
* respective engine.</p>
208+
* <p>
209+
* {@link Engine} scoped services, if they exist, can be found on the
210+
* respective engine.
213211
*
214212
* @return The service provider.
215213
*/

0 commit comments

Comments
 (0)