Alternate message for bedrock players

This commit is contained in:
Heliosares
2023-12-21 09:45:40 -05:00
parent 310536d1a5
commit 356d8912c6
3 changed files with 6 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ command:
notify-player: '&p<admin> &srecovered your inventory from &p<time> &sago.'
notify-player-claim-button: '&a[Claim]'
notify-player-claim-hover: '&aClick to claim your recovered inventory'
notify-player-claim-alt: '&fRun &b/claiminv&f to claim.'
notify-player-ensure-room: '&tEnsure you have room in your inventory before claiming!'
notify-player-waiting: '&aYou have a restored inventory waiting to be claimed!'
item-viewer: 'Item Viewer'

View File

@@ -117,6 +117,7 @@ public class Language {
COMMAND__INV__NOTIFY_PLAYER("admin", "time"),
COMMAND__INV__NOTIFY_PLAYER_CLAIM_BUTTON,
COMMAND__INV__NOTIFY_PLAYER_CLAIM_HOVER,
COMMAND__INV__NOTIFY_PLAYER_CLAIM_ALT,
COMMAND__INV__NOTIFY_PLAYER_ENSURE_ROOM,
COMMAND__INV__NOTIFY_PLAYER_WAITING,
COMMAND__INV__RECOVERED("admin", "target", "optional_s", "time"),

View File

@@ -236,8 +236,12 @@ public class PlayerListener implements Listener {
senderAdapter.sendLang(Language.L.COMMAND__INV__NOTIFY_PLAYER_ENSURE_ROOM);
ComponentBuilder message = new ComponentBuilder();
message.append(ChatColor.COLOR_CHAR + "f\n ");
if (e.getPlayer().getUniqueId().getMostSignificantBits() == 0) { // bedrock player
message.append(Language.L.COMMAND__INV__NOTIFY_PLAYER_CLAIM_ALT.translate());
} else {
message.append(Language.L.COMMAND__INV__NOTIFY_PLAYER_CLAIM_BUTTON.translate()).event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/claiminv"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(Language.L.COMMAND__CLAIMINV__CLAIM_BUTTON__HOVER.translate())));
}
message.append("\n" + ChatColor.COLOR_CHAR + "f").event((ClickEvent) null).event((HoverEvent) null);
e.getPlayer().spigot().sendMessage(message.create());
e.getPlayer().playSound(e.getPlayer().getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1, 1);