Skip to content

Commit

Permalink
fixup javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Jan 30, 2025
1 parent 1be0e16 commit dfc7c32
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public SessionLoadResourcePacksEvent(@NonNull GeyserConnection connection) {
/**
* Gets an unmodifiable list of {@link ResourcePack}'s that will be sent to the client.
*
* @return an unmodifiable list of resource packs that will be sent to the client.
* @return an unmodifiable list of resource packs that will be sent to the client
*/
public abstract @NonNull List<ResourcePack> resourcePacks();

Expand All @@ -69,9 +69,9 @@ public SessionLoadResourcePacksEvent(@NonNull GeyserConnection connection) {
* Registers a {@link ResourcePack} to be sent to the client, alongside
* specific options.
*
* @param resourcePack The resource pack that will be sent to the client.
* @param resourcePack The resource pack that will be sent to the client
* @param options {@link ResourcePackOption}'s that specify how clients load the pack
* @throws ResourcePackException when an issue occurred during pack registration.
* @throws ResourcePackException if an issue occurred during pack registration
*/
public abstract void register(@NonNull ResourcePack resourcePack, @Nullable ResourcePackOption<?>... options);

Expand All @@ -80,8 +80,8 @@ public SessionLoadResourcePacksEvent(@NonNull GeyserConnection connection) {
*
* @param uuid the resource pack uuid to register the options for
* @param options the options to register for the pack
* @throws IllegalArgumentException if the pack is not registered.
* @throws ResourcePackException when an issue occurred during resource pack option registration.
* @throws IllegalArgumentException if the pack is not registered
* @throws ResourcePackException if an issue occurred during resource pack option registration
*/
public abstract void registerOptions(@NonNull UUID uuid, @NonNull ResourcePackOption<?>... options);

Expand All @@ -90,7 +90,8 @@ public SessionLoadResourcePacksEvent(@NonNull GeyserConnection connection) {
* These are not modifiable.
*
* @param uuid the resource pack for which the options are set
* @return a list of {@link ResourcePackOption
* @return a list of {@link ResourcePackOption}
* @throws ResourcePackException if the pack does not exist
*/
public abstract Collection<ResourcePackOption<?>> options(@NonNull UUID uuid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,27 @@ public abstract class GeyserDefineResourcePacksEvent implements Event {
/**
* Gets an unmodifiable list of {@link ResourcePack}'s that will be sent to clients.
*
* @return an unmodifiable list of resource packs that will be sent to clients.
* @return an unmodifiable list of resource packs that will be sent to clients
*/
public abstract @NonNull List<ResourcePack> resourcePacks();

/**
* Registers a {@link ResourcePack} to be sent to the client, optionally alongside
* {@link ResourcePackOption} options specifying how it will be applied on clients.
*
* @param pack a resource pack that will be sent to the client.
* @param pack a resource pack that will be sent to the client
* @param options {@link ResourcePackOption}'s that specify how clients load the pack
* @throws ResourcePackException when an issue occurred during pack registration.
* @throws ResourcePackException if an issue occurred during pack registration
*/
public abstract void register(@NonNull ResourcePack pack, @Nullable ResourcePackOption<?>... options);

/**
* Sets {@link ResourcePackOption}'s for a resource pack
* Sets {@link ResourcePackOption}'s for a resource pack.
*
* @param uuid the resource pack uuid to register the options for
* @param options the options to register for the pack
* @throws IllegalArgumentException if the pack is not registered.
* @throws ResourcePackException when an issue occurred during resource pack option registration.
* @throws IllegalArgumentException if the pack is not registered
* @throws ResourcePackException if an issue occurred during resource pack option registration
*/
public abstract void registerOptions(@NonNull UUID uuid, @NonNull ResourcePackOption<?>... options);

Expand All @@ -74,7 +74,7 @@ public abstract class GeyserDefineResourcePacksEvent implements Event {
*
* @param uuid the resource pack uuid for which the options are set
* @return a list of {@link ResourcePackOption}
* @throws ResourcePackException if the pack does not exist.
* @throws ResourcePackException if the pack does not exist
*/
public abstract Collection<ResourcePackOption<?>> options(@NonNull UUID uuid);

Expand All @@ -83,14 +83,14 @@ public abstract class GeyserDefineResourcePacksEvent implements Event {
*
* @param uuid the resource pack for which the option type is set
* @param type the {@link ResourcePackOption.Type} of the option to query
* @throws ResourcePackException if the pack does not exist.
* @throws ResourcePackException if the pack does not exist
*/
public abstract @Nullable ResourcePackOption<?> option(@NonNull UUID uuid, ResourcePackOption.@NonNull Type type);

/**
* Unregisters a {@link ResourcePack} from being sent to clients.
*
* @param uuid the uuid of the resource pack to remove.
* @param uuid the uuid of the resource pack to remove
*/
public abstract void unregister(@NonNull UUID uuid);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@

package org.geysermc.geyser.api.pack.exception;

import java.io.Serial;

/**
* Used to indicate an exception that occurred while handling resource pack registration,
* or during resource pack option validation.
*/
public class ResourcePackException extends IllegalArgumentException {

@Serial
private static final long serialVersionUID = 1L;

/**
* The {@link Cause} of this exception.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
public interface SubpackOption extends ResourcePackOption<String> {

/**
* Creates a subpack option based on a {@link ResourcePackManifest.Subpack}
* Creates a subpack option based on a {@link ResourcePackManifest.Subpack}.
*
* @param subpack the chosen subpack
* @return a subpack option specifying that subpack
Expand All @@ -56,7 +56,7 @@ static SubpackOption named(@NonNull String subpackName) {
}

/**
* Creates a subpack option with no subpack specified
* Creates a subpack option with no subpack specified.
*
* @return a subpack option specifying no subpack
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public interface UrlFallbackOption extends ResourcePackOption<Boolean> {

/**
* Whether to fall back to serving packs over the raknet connection
*
* @param fallback whether to fall back
* @return a UrlFallbackOption with the specified behavior
*/
Expand Down

0 comments on commit dfc7c32

Please sign in to comment.