mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-26 18:19:10 +00:00
Fix notifications through Toast AndJam library
This commit is contained in:
@@ -123,17 +123,13 @@ public abstract class EventListener {
|
||||
private void handleSynchronisationCompletion(@NotNull OnlineUser user, boolean succeeded) {
|
||||
if (succeeded) {
|
||||
switch (plugin.getSettings().notificationDisplaySlot) {
|
||||
case CHAT -> plugin.getLocales().getLocale("synchronisation_complete")
|
||||
case CHAT -> plugin.getLocales().getLocale("synchronisation_complete")
|
||||
.ifPresent(user::sendMessage);
|
||||
case ACTION_BAR -> plugin.getLocales().getLocale("synchronisation_complete")
|
||||
.ifPresent(user::sendActionBar);
|
||||
case ACTION_BAR -> plugin.getLocales().getLocale("synchronisation_complete")
|
||||
.ifPresent(user::sendActionBar);
|
||||
case TOAST -> {
|
||||
// todo locale implementation
|
||||
user.sendToast(new MineDown("Synchronization complete"),
|
||||
new MineDown("Your data has been synchronized"),
|
||||
"minecraft:structure_void",
|
||||
"task");
|
||||
}
|
||||
case TOAST -> plugin.getLocales().getLocale("synchronisation_complete")
|
||||
.ifPresent(locale -> user.sendToast(locale, new MineDown(""),
|
||||
"minecraft:bell", "TASK"));
|
||||
}
|
||||
plugin.getDatabase().ensureUser(user).join();
|
||||
lockedPlayers.remove(user.uuid);
|
||||
|
||||
@@ -91,13 +91,9 @@ public class RedisManager {
|
||||
.ifPresent(user::sendMessage);
|
||||
case ACTION_BAR -> plugin.getLocales().getLocale("data_update_complete")
|
||||
.ifPresent(user::sendActionBar);
|
||||
case TOAST -> {
|
||||
// todo locale implementation
|
||||
user.sendToast(new MineDown("Data updated"),
|
||||
new MineDown("Your data has been updated"),
|
||||
"minecraft:structure_void",
|
||||
"task");
|
||||
}
|
||||
case TOAST -> plugin.getLocales().getLocale("data_update_complete")
|
||||
.ifPresent(locale -> user.sendToast(locale, new MineDown(""),
|
||||
"minecraft:bell", "TASK"));
|
||||
}
|
||||
plugin.getEventCannon().fireSyncCompleteEvent(user);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user