Skip to content

Commit

Permalink
Pluralize pack sending methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 committed Dec 10, 2023
1 parent e8aee81 commit 3e30a6f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
42 changes: 21 additions & 21 deletions api/src/main/java/net/kyori/adventure/audience/Audience.java
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,12 @@ default void openBook(final @NotNull Book book) {
*/
@SuppressWarnings("checkstyle:MethodName")
@ForwardingAudienceOverrideNotRequired
default void setResourcePack(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
default void setResourcePacks(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
final ResourcePackRequest[] otherReqs = new ResourcePackRequest[others.length];
for (int i = 0; i < others.length; i++) {
otherReqs[i] = others[i].asResourcePackRequest();
}
this.setResourcePack(request.asResourcePackRequest(), otherReqs);
this.setResourcePacks(request.asResourcePackRequest(), otherReqs);
}

/**
Expand All @@ -740,7 +740,7 @@ default void setResourcePack(final @NotNull ResourcePackRequestLike request, fin
* @since 4.15.0
*/
@SuppressWarnings("checkstyle:MethodName")
default void setResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
default void setResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
}

/**
Expand All @@ -756,12 +756,12 @@ default void setResourcePack(final @NotNull ResourcePackRequest request, final @
*/
@SuppressWarnings("checkstyle:MethodName")
@ForwardingAudienceOverrideNotRequired
default void setResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
default void setResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
final ResourcePackRequest[] otherReqs = new ResourcePackRequest[others.length];
for (int i = 0; i < others.length; i++) {
otherReqs[i] = others[i].asResourcePackRequest();
}
this.setResourcePack(cb, request.asResourcePackRequest(), otherReqs);
this.setResourcePacks(cb, request.asResourcePackRequest(), otherReqs);
}

/**
Expand All @@ -776,45 +776,45 @@ default void setResourcePack(final @NotNull ResourcePackCallback cb, final @NotN
* @since 4.15.0
*/
@SuppressWarnings("checkstyle:MethodName")
default void setResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
default void setResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
}

/**
* Sends resource pack requests to this audience, adding to any existing resource packs that might be present.
*
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePack(ResourcePackRequestLike, ResourcePackRequestLike...)}.</p>
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePacks(ResourcePackRequestLike, ResourcePackRequestLike...)}.</p>
*
* @param request the resource pack request
* @param others other requests
* @see ResourcePackRequest
* @since 4.15.0
*/
@ForwardingAudienceOverrideNotRequired
default void sendResourcePack(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
default void sendResourcePacks(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
final ResourcePackRequest[] otherReqs = new ResourcePackRequest[others.length];
for (int i = 0; i < others.length; i++) {
otherReqs[i] = others[i].asResourcePackRequest();
}
this.sendResourcePack(request.asResourcePackRequest(), otherReqs);
this.sendResourcePacks(request.asResourcePackRequest(), otherReqs);
}

/**
* Sends resource pack requests to this audience, adding to any existing resource packs that might be present.
*
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePack(ResourcePackRequest, ResourcePackRequest...)}.</p>
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePacks(ResourcePackRequest, ResourcePackRequest...)}.</p>
*
* @param request the resource pack request
* @param others other requests
* @see ResourcePackRequest
* @since 4.15.0
*/
default void sendResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
default void sendResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
}

/**
* Sends resource pack requests to this audience, adding to any existing resource packs that might be present.
*
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePack(ResourcePackRequestLike, ResourcePackRequestLike...)}.</p>
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePacks(ResourcePackRequestLike, ResourcePackRequestLike...)}.</p>
*
* @param cb a callback to be executed when resource pack events associated with this application are received
* @param request the resource pack request
Expand All @@ -823,26 +823,26 @@ default void sendResourcePack(final @NotNull ResourcePackRequest request, final
* @since 4.15.0
*/
@ForwardingAudienceOverrideNotRequired
default void sendResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
default void sendResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
final ResourcePackRequest[] otherReqs = new ResourcePackRequest[others.length];
for (int i = 0; i < others.length; i++) {
otherReqs[i] = others[i].asResourcePackRequest();
}
this.sendResourcePack(cb, request.asResourcePackRequest(), otherReqs);
this.sendResourcePacks(cb, request.asResourcePackRequest(), otherReqs);
}

/**
* Sends resource pack requests to this audience, adding to any existing resource packs that might be present.
*
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePack(ResourcePackRequest, ResourcePackRequest...)}.</p>
* <p>Multiple resource packs are only supported since 1.20.3. On older versions, this behaves identically to {@link #setResourcePacks(ResourcePackRequest, ResourcePackRequest...)}.</p>
*
* @param cb a callback to be executed when resource pack events associated with this application are received
* @param request the resource pack request
* @param others other requests
* @see ResourcePackRequest
* @since 4.15.0
*/
default void sendResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
default void sendResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
}

/**
Expand All @@ -854,12 +854,12 @@ default void sendResourcePack(final @NotNull ResourcePackCallback cb, final @Not
* @sinceMinecraft 1.20.3
*/
@ForwardingAudienceOverrideNotRequired
default void removeResourcePack(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
default void removeResourcePacks(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
final ResourcePackRequest[] otherReqs = new ResourcePackRequest[others.length];
for (int i = 0; i < others.length; i++) {
otherReqs[i] = others[i].asResourcePackRequest();
}
this.removeResourcePack(request.asResourcePackRequest(), otherReqs);
this.removeResourcePacks(request.asResourcePackRequest(), otherReqs);
}

/**
Expand All @@ -872,12 +872,12 @@ default void removeResourcePack(final @NotNull ResourcePackRequestLike request,
* @sinceMinecraft 1.20.3
*/
@ForwardingAudienceOverrideNotRequired
default void removeResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
default void removeResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
final UUID[] otherIds = new UUID[others.length];
for (int i = 0; i < others.length; i++) {
otherIds[i] = others[i].id();
}
this.removeResourcePack(request.id(), otherIds);
this.removeResourcePacks(request.id(), otherIds);
}

/**
Expand All @@ -888,7 +888,7 @@ default void removeResourcePack(final @NotNull ResourcePackRequest request, fina
* @since 4.15.0
* @sinceMinecraft 1.20.3
*/
default void removeResourcePack(final @NotNull UUID id, final @NotNull UUID@NotNull... others) {
default void removeResourcePacks(final @NotNull UUID id, final @NotNull UUID@NotNull... others) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@ public void openBook(final Book.@NotNull Builder book) {
}

@Override
public void sendResourcePack(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
public void sendResourcePacks(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
}

@Override
public void setResourcePack(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike @NotNull ... others) {
public void setResourcePacks(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike @NotNull ... others) {
}

@Override
public void removeResourcePack(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
public void removeResourcePacks(final @NotNull ResourcePackRequestLike request, final @NotNull ResourcePackRequestLike@NotNull... others) {
}

@Override
public void removeResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
public void removeResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,28 +203,28 @@ default void openBook(final @NotNull Book book) {
}

@Override
default void setResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
for (final Audience audience : this.audiences()) audience.setResourcePack(request, others);
default void setResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
for (final Audience audience : this.audiences()) audience.setResourcePacks(request, others);
}

@Override
default void setResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
for (final Audience audience : this.audiences()) audience.setResourcePack(cb, request, others);
default void setResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
for (final Audience audience : this.audiences()) audience.setResourcePacks(cb, request, others);
}

@Override
default void sendResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
for (final Audience audience : this.audiences()) audience.sendResourcePack(request, others);
default void sendResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
for (final Audience audience : this.audiences()) audience.sendResourcePacks(request, others);
}

@Override
default void sendResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull ... others) {
for (final Audience audience : this.audiences()) audience.sendResourcePack(cb, request, others);
default void sendResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull ... others) {
for (final Audience audience : this.audiences()) audience.sendResourcePacks(cb, request, others);
}

@Override
default void removeResourcePack(final @NotNull UUID id, final @NotNull UUID @NotNull ... others) {
for (final Audience audience : this.audiences()) audience.removeResourcePack(id, others);
default void removeResourcePacks(final @NotNull UUID id, final @NotNull UUID @NotNull ... others) {
for (final Audience audience : this.audiences()) audience.removeResourcePacks(id, others);
}

@Override
Expand Down Expand Up @@ -396,28 +396,28 @@ default void openBook(final @NotNull Book book) {
}

@Override
default void setResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest... others) {
this.audience().setResourcePack(request, others);
default void setResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest... others) {
this.audience().setResourcePacks(request, others);
}

@Override
default void setResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
this.audience().setResourcePack((uuid, status, audience) -> cb.packEventReceived(uuid, status, this), request, others);
default void setResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
this.audience().setResourcePacks((uuid, status, audience) -> cb.packEventReceived(uuid, status, this), request, others);
}

@Override
default void sendResourcePack(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
this.audience().sendResourcePack(request, others);
default void sendResourcePacks(final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest@NotNull... others) {
this.audience().sendResourcePacks(request, others);
}

@Override
default void sendResourcePack(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
this.audience().sendResourcePack((uuid, status, audience) -> cb.packEventReceived(uuid, status, this), request, others);
default void sendResourcePacks(final @NotNull ResourcePackCallback cb, final @NotNull ResourcePackRequest request, final @NotNull ResourcePackRequest @NotNull ... others) {
this.audience().sendResourcePacks((uuid, status, audience) -> cb.packEventReceived(uuid, status, this), request, others);
}

@Override
default void removeResourcePack(final @NotNull UUID id, final @NotNull UUID @NotNull ... others) {
this.audience().removeResourcePack(id, others);
default void removeResourcePacks(final @NotNull UUID id, final @NotNull UUID @NotNull ... others) {
this.audience().removeResourcePacks(id, others);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* Represents a resource pack request that can be sent to players.
*
* @see Audience#sendResourcePack(ResourcePackRequest, ResourcePackRequest...)
* @see Audience#sendResourcePacks(ResourcePackRequest, ResourcePackRequest...)
* @since 4.15.0
*/
public interface ResourcePackRequest extends Examinable, ResourcePackRequestLike {
Expand Down

0 comments on commit 3e30a6f

Please sign in to comment.