Skip to content

Commit

Permalink
Replace Component#appendNewLine with Component.append(Component.newli…
Browse files Browse the repository at this point in the history
…ne()) for backwards compatibility
  • Loading branch information
ItsNature committed Oct 7, 2024
1 parent 96204a1 commit fa5d83c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void displayNotificationExample(Player viewer) {
this.notificationModule.displayNotification(apolloPlayer, Notification.builder()
.titleComponent(Component.text("UHC Announcement", NamedTextColor.GREEN))
.descriptionComponent(Component.text("UHC starts in 5 minutes...", NamedTextColor.RED)
.appendNewline()
.append(Component.newline())
.append(Component.text("Get ready!", NamedTextColor.WHITE))
.appendNewline()
.append(Component.newline())
.append(Component.text("Good luck!", NamedTextColor.GOLD))
)
.resourceLocation("icons/golden_apple.png") // This field is optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public void displayNotificationExample(Player viewer) {
));
message.addProperty("description_adventure_json_lines", AdventureUtil.toJson(
Component.text("UHC starts in 5 minutes...", NamedTextColor.RED)
.appendNewline()
.append(Component.newline())
.append(Component.text("Get ready!", NamedTextColor.WHITE))
.appendNewline()
.append(Component.newline())
.append(Component.text("Good luck!", NamedTextColor.GOLD))
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public void displayNotificationExample(Player viewer) {
))
.setDescriptionAdventureJsonLines(AdventureUtil.toJson(
Component.text("UHC starts in 5 minutes...", NamedTextColor.RED)
.appendNewline()
.append(Component.newline())
.append(Component.text("Get ready!", NamedTextColor.WHITE))
.appendNewline()
.append(Component.newline())
.append(Component.text("Good luck!", NamedTextColor.GOLD))
)
)
Expand Down
12 changes: 6 additions & 6 deletions docs/developers/modules/notification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public void displayNotificationExample(Player viewer) {
this.notificationModule.displayNotification(apolloPlayer, Notification.builder()
.titleComponent(Component.text("UHC Announcement", NamedTextColor.GREEN))
.descriptionComponent(Component.text("UHC starts in 5 minutes...", NamedTextColor.RED)
.appendNewline()
.append(Component.newline())
.append(Component.text("Get ready!", NamedTextColor.WHITE))
.appendNewline()
.append(Component.newline())
.append(Component.text("Good luck!", NamedTextColor.GOLD))
)
.resourceLocation("icons/golden_apple.png") // This field is optional
Expand Down Expand Up @@ -119,9 +119,9 @@ public void displayNotificationExample(Player viewer) {
))
.setDescriptionAdventureJsonLines(AdventureUtil.toJson(
Component.text("UHC starts in 5 minutes...", NamedTextColor.RED)
.appendNewline()
.append(Component.newline())
.append(Component.text("Get ready!", NamedTextColor.WHITE))
.appendNewline()
.append(Component.newline())
.append(Component.text("Good luck!", NamedTextColor.GOLD))
)
)
Expand Down Expand Up @@ -157,9 +157,9 @@ public void displayNotificationExample(Player viewer) {
));
message.addProperty("description_adventure_json_lines", AdventureUtil.toJson(
Component.text("UHC starts in 5 minutes...", NamedTextColor.RED)
.appendNewline()
.append(Component.newline())
.append(Component.text("Get ready!", NamedTextColor.WHITE))
.appendNewline()
.append(Component.newline())
.append(Component.text("Good luck!", NamedTextColor.GOLD))
));

Expand Down

1 comment on commit fa5d83c

@LunarClientBot
Copy link
Collaborator

@LunarClientBot LunarClientBot commented on fa5d83c Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📄 Documentation Deployment

Status:✅ Completed
Environment:preview
URL:https://cec51d7d.lunarclient-dev.pages.dev

Please sign in to comment.