Closed ItsNature closed 7 months ago
Description: Adds Icon support to Notifications with client-side changes that support SVG format.
Icon
Code Example (If applicable):
public void displayNotificationItemExample(Player viewer) { Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId()); apolloPlayerOpt.ifPresent(apolloPlayer -> { 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.text("Get ready!", NamedTextColor.WHITE)) .appendNewline() .append(Component.text("Good luck!", NamedTextColor.GOLD)) ) .displayTime(Duration.ofSeconds(5)) .icon(ItemStackIcon.builder() .itemName("GOLDEN_APPLE") .build() ) .build() ); }); } public void displayNotificationResourceExample(Player viewer) { Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId()); apolloPlayerOpt.ifPresent(apolloPlayer -> { 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.text("Get ready!", NamedTextColor.WHITE)) .appendNewline() .append(Component.text("Good luck!", NamedTextColor.GOLD)) ) .displayTime(Duration.ofSeconds(5)) .icon(SimpleResourceLocationIcon.builder() .resourceLocation("lunar:logo/logo-200x182.svg") .size(12) .build() ) .build() ); }); }
Screenshots and/or Videos (If applicable): Using ItemStackIcon
ItemStackIcon
Using SimpleResourceLocationIcon with an SVG image
SimpleResourceLocationIcon
feature/add-module
bugfix/fix-issue
Overview
Description: Adds
Icon
support to Notifications with client-side changes that support SVG format.Code Example (If applicable):
Screenshots and/or Videos (If applicable): Using
ItemStackIcon
Using
SimpleResourceLocationIcon
with an SVG imageReview Request Checklist
feature/add-module
&bugfix/fix-issue
)