9
0
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:
William
2022-11-17 02:34:52 +00:00
parent 6fef9c4eae
commit d682e6e6c6
4 changed files with 24 additions and 28 deletions

View File

@@ -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);

View File

@@ -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 {