Skip to content

Commit

Permalink
Remove @ApiStatus.Internal annotations and adjust nullability.
Browse files Browse the repository at this point in the history
The commit removes the @ApiStatus.Internal annotations from several methods, making them accessible outside their current package. Additionally, it corrects the nullability annotation for the Title.Times parameter in the sendTitle method to ensure proper handling of nullable arguments.
  • Loading branch information
NonSwag committed Oct 29, 2024
1 parent 600360a commit 9d4d1b8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions i18n/src/main/java/core/i18n/file/ComponentBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
import net.kyori.adventure.title.Title;
import net.kyori.adventure.translation.GlobalTranslator;
import net.kyori.adventure.translation.TranslationRegistry;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -141,7 +140,6 @@ public ComponentBundle register(String baseName, Locale locale) {
* @param key the key
* @return the format
*/
@ApiStatus.Internal
public @Nullable String format(Locale locale, String key) {
var request = files.get(locale);
if (request != null && request.containsKey(key))
Expand All @@ -161,7 +159,6 @@ public ComponentBundle register(String baseName, Locale locale) {
* @param key the key
* @return the format
*/
@ApiStatus.Internal
public @Nullable String format(Audience audience, String key) {
return format(mapping().apply(audience), key);
}
Expand Down Expand Up @@ -250,7 +247,6 @@ public Component[] components(Audience audience, String key, TagResolver... tagR
* @param tagResolvers a series of tag resolvers to apply extra tags from, last specified taking priority
* @return the {@link MiniMessage#deserialize(String, TagResolver...) deserialized} component
*/
@ApiStatus.Internal
public Component deserialize(String message, TagResolver... tagResolvers) {
return miniMessage.deserialize(message, tagResolvers);
}
Expand All @@ -262,7 +258,6 @@ public Component deserialize(String message, TagResolver... tagResolvers) {
* @param tagResolvers a series of tag resolvers to apply extra tags from, last specified taking priority
* @return the {@link MiniMessage#deserialize(String, TagResolver...) deserialized} component
*/
@ApiStatus.Internal
public Component[] deserializeArray(String message, TagResolver... tagResolvers) {
return Arrays.stream(message.split("\n|<newline>"))
.map(s -> deserialize(s, tagResolvers))
Expand Down Expand Up @@ -358,7 +353,7 @@ public void sendTitle(Audience audience, String title, String subtitle, TagResol
* @param times the timings of the title
* @param tagResolvers a series of tag resolvers to apply extra tags from, last specified taking priority
*/
public void sendTitle(Audience audience, @Nullable String title, @Nullable String subtitle, @Nullable Title.Times times, TagResolver... tagResolvers) {
public void sendTitle(Audience audience, @Nullable String title, @Nullable String subtitle, Title.@Nullable Times times, TagResolver... tagResolvers) {
var titleComponent = title != null ? nullable(mapping.apply(audience), title, tagResolvers) : null;
var subtitleComponent = subtitle != null ? nullable(mapping.apply(audience), subtitle, tagResolvers) : null;
if (titleComponent != null || subtitleComponent != null) audience.showTitle(Title.title(
Expand Down

0 comments on commit 9d4d1b8

Please sign in to comment.