Update /tpignore locale

This commit is contained in:
William committed 2022-08-22 16:49:57 +01:00
1 parent 8adbc49a61
commit 632d43d131
3 files changed
+12 -7

No files matched your search

@@ -1,5 +1,6 @@
package net.william278.huskhomes.command; package net.william278.huskhomes.command;
import de.themoep.minedown.MineDown;
import net.william278.huskhomes.HuskHomes; import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.player.OnlineUser; import net.william278.huskhomes.player.OnlineUser;
import net.william278.huskhomes.player.UserData; import net.william278.huskhomes.player.UserData;
@@ -28,7 +29,8 @@ public class TpIgnoreCommand extends CommandBase {
plugin.getDatabase().getUserData(onlineUser.uuid).thenAccept( plugin.getDatabase().getUserData(onlineUser.uuid).thenAccept(
userData -> userData.ifPresent(data -> plugin.getDatabase().updateUserData(new UserData(onlineUser, userData -> userData.ifPresent(data -> plugin.getDatabase().updateUserData(new UserData(onlineUser,
data.homeSlots(), isIgnoringRequests, data.rtpCooldown())).join())).thenRun( data.homeSlots(), isIgnoringRequests, data.rtpCooldown())).join())).thenRun(
() -> plugin.getLocales().getLocale("tpignore_toggle_" + (isIgnoringRequests ? "on" : "off")) () -> plugin.getLocales().getRawLocale("tpignore_toggle_" + (isIgnoringRequests ? "on" : "off"),
.ifPresent(onlineUser::sendMessage)); plugin.getLocales().getRawLocale("tpignore_toggle_button").orElse(""))
.ifPresent(locale -> onlineUser.sendMessage(new MineDown(locale))));
} }
} }
@@ -1,5 +1,6 @@
package net.william278.huskhomes.listener; package net.william278.huskhomes.listener;
import de.themoep.minedown.MineDown;
import net.william278.huskhomes.HuskHomes; import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.player.OnlineUser; import net.william278.huskhomes.player.OnlineUser;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@@ -73,8 +74,9 @@ public class EventListener {
// Send a reminder message if they are still ignoring requests // Send a reminder message if they are still ignoring requests
if (ignoringRequests) { if (ignoringRequests) {
plugin.getLocales().getLocale("tpignore_on_reminder") plugin.getLocales().getRawLocale("tpignore_on_reminder",
.ifPresent(onlineUser::sendMessage); plugin.getLocales().getRawLocale("tpignore_toggle_button").orElse(""))
.ifPresent(locale -> onlineUser.sendMessage(new MineDown(locale)));
} }
} }
}).join(); }).join();
+4 -3
View File
@@ -95,9 +95,10 @@ delete_all_warps_success: '[Successfully deleted all](#00fb9a) [%1%](#00fb9a bol
teleporting_complete_console: '[Console teleported you to %1%.](gray)' teleporting_complete_console: '[Console teleported you to %1%.](gray)'
spawn_warp_default_description: 'The /spawn position of the server' spawn_warp_default_description: 'The /spawn position of the server'
tpignore_toggle_on: '[You are now](#00fb9a) [ignoring](#00fb9a bold) [incoming teleport requests.](#00fb9a) [(Click to toggle)](gray show_text=&7Click to listen for incoming teleport requests run_command=/huskhomes:tpignore)' tpignore_toggle_on: '[You are now](#00fb9a) [ignoring](#00fb9a bold) [incoming teleport requests.](#00fb9a) %1%'
tpignore_toggle_off: '[You are now](#00fb9a) [listening](#00fb9a bold) [to any incoming teleport requests.](#00fb9a) [(Click to toggle)](gray show_text=&7Click to ignore incoming teleport requests run_command=/huskhomes:tpignore)' tpignore_toggle_off: '[You are now](#00fb9a) [listening](#00fb9a bold) [to incoming teleport requests.](#00fb9a) %1%'
tpignore_on_reminder: '[You are currently ignoring incoming teleport requests!](gray) [(Click to toggle)](gray show_text=&7Click to listen for incoming teleport requests run_command=/huskhomes:tpignore)' tpignore_on_reminder: '[You are currently ignoring incoming teleport requests!](gray) %1%'
tpignore_toggle_button: '[[🔔 Toggle…]](#ffc43b show_text=&#ffc43b&Click to toggle:\n&7Toggle ignoring/listening to incoming teleport requests run_command=/huskhomes:tpignore)'
teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)' teleporting_all_players: '[Teleporting all players to your position…](#00fb9a)'