Skip to content

Commit

Permalink
Cleanup lore
Browse files Browse the repository at this point in the history
  • Loading branch information
Rollczi committed Sep 8, 2024
1 parent e09dfe4 commit 9abd2bc
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,15 @@ private Supplier<GuiItem> toItem(Player player, User user, SkullData skullData,
UUID uuid = user.uuid();

return () -> {
List<Component> lore;
boolean isReceiverSelected = uuid.equals(this.state.getReceiver());
if (isReceiverSelected) {
// This lore indicates the receiver is already selected
lore = List.of(this.miniMessage.deserialize(this.config.guiSettings.parcelReceiverSetLine));
} else {
// This lore indicates the user can click to select this receiver
lore = List.of(this.miniMessage.deserialize(this.config.guiSettings.parcelReceiverNotSetLine));
}
String lore = isReceiverSelected
? this.config.guiSettings.parcelReceiverSetLine
: this.config.guiSettings.parcelReceiverNotSetLine;

return ItemBuilder.skull()
.texture(skullData.getValue())
.name(this.miniMessage.deserialize(user.name()))
.lore(lore)
.lore(this.miniMessage.deserialize(lore))
.glow(uuid.equals(this.state.getReceiver()))
.asGuiItem(event -> {
if (uuid.equals(this.state.getReceiver())) {
Expand Down

0 comments on commit 9abd2bc

Please sign in to comment.