mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-28 11:09:11 +00:00
Fix notifications through Toast AndJam library
This commit is contained in:
@@ -536,7 +536,7 @@ public class BukkitPlayer extends OnlineUser {
|
||||
}
|
||||
}, () -> BukkitHuskSync.getInstance().getLoggingAdapter().log(Level.WARNING,
|
||||
"Could not set " + player.getName() + "'s persistent data key " + keyString +
|
||||
" as it has an invalid type. Skipping!"));
|
||||
" as it has an invalid type. Skipping!"));
|
||||
}
|
||||
});
|
||||
}).exceptionally(throwable -> {
|
||||
@@ -633,14 +633,18 @@ public class BukkitPlayer extends OnlineUser {
|
||||
@Override
|
||||
public void sendToast(@NotNull MineDown title, @NotNull MineDown description,
|
||||
@NotNull String iconMaterial, @NotNull String backgroundType) {
|
||||
final Material material = Material.matchMaterial(iconMaterial);
|
||||
Toast.builder(BukkitHuskSync.getInstance())
|
||||
.setTitle(title.toComponent())
|
||||
.setDescription(description.toComponent())
|
||||
.setIcon(material != null ? material : Material.BARRIER)
|
||||
.setFrameType(FrameType.valueOf(backgroundType))
|
||||
.build()
|
||||
.show(player);
|
||||
try {
|
||||
final Material material = Material.matchMaterial(iconMaterial);
|
||||
Toast.builder(BukkitHuskSync.getInstance())
|
||||
.setTitle(title.toComponent())
|
||||
.setDescription(description.toComponent())
|
||||
.setIcon(material != null ? material : Material.BARRIER)
|
||||
.setFrameType(FrameType.valueOf(backgroundType))
|
||||
.build()
|
||||
.show(player);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user