@EventHandler public void onPlayerLocaleChange(PlayerLocaleChangeEvent event) { for (ItemStack item : event.getPlayer().getInventory().getContents()) { if (item != null) { if (item.getType().equals(Material.LEATHER_HELMET)) { if (item.hasItemMeta()) { if (item.getItemMeta().hasDisplayName()) { ItemMeta meta = item.getItemMeta(); StringBuilder name = new StringBuilder(); name.append(ChatColor.GREEN); name.append(ChatColor.BOLD); StringBuilder lore = new StringBuilder(); lore.append(ChatColor.DARK_PURPLE); lore.append(new LocalizedChatMessage(ChatConstant.UI_TEAM_JOIN_TIP).getMessage(event.getPlayer().getLocale())); if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "" + ChatColor.BOLD + new LocalizedChatMessage(ChatConstant.UI_TEAM_SELECTION).getMessage(event.getOldLocale()))) { name.append(new LocalizedChatMessage(ChatConstant.UI_TEAM_SELECTION).getMessage(event.getNewLocale())); meta.setDisplayName(name.toString()); meta.setLore(Arrays.asList(lore.toString())); } else if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "" + ChatColor.BOLD + new LocalizedChatMessage(ChatConstant.UI_TEAM_CLASS_SELECTION).getMessage(event.getOldLocale()))) { name.append(new LocalizedChatMessage(ChatConstant.UI_TEAM_CLASS_SELECTION).getMessage(event.getNewLocale())); meta.setDisplayName(name.toString()); meta.setLore(Arrays.asList(lore.toString())); } item.setItemMeta(meta); } } } } } }
@EventHandler public void onPlayerLocaleChange(PlayerLocaleChangeEvent event) { ItemStack oldItem = getTeamPicker(event.getOldLocale() != null ? event.getOldLocale() : "en_US"); ItemStack newItem = getTeamPicker(event.getNewLocale()); for (ItemStack item : event.getPlayer().getInventory().getContents()) { if (item != null && item.equals(oldItem)) { item.setItemMeta(newItem.getItemMeta()); } } }
@EventHandler public void onPlayerLocaleChange(PlayerLocaleChangeEvent event) { ItemStack oldItem = getSpectatorItem(event.getOldLocale() != null ? event.getOldLocale() : "en_US"); ItemStack newItem = getSpectatorItem(event.getNewLocale()); for (ItemStack item : event.getPlayer().getInventory().getContents()) { if (item != null && item.isSimilar(oldItem)) { item.setItemMeta(newItem.getItemMeta()); } } }
@EventHandler public void handleLocaleChange(final PlayerLocaleChangeEvent event) { final MatchPlayer player = getMatch().getPlayer(event.getPlayer()); if(player != null) refreshKit(player); }
@EventHandler(priority = EventPriority.MONITOR) public void onLocaleChange(PlayerLocaleChangeEvent event) { userService.update(userStore.getUser(event.getPlayer()), (UserDoc.Locale) event::getNewLocale); }
@EventHandler public void onChangeLocale(PlayerLocaleChangeEvent event) { if (!AntiLaby.getInstance().loadedFeatures.contains(PluginFeature.PROTOCOL_LIB)) LanguageManager.INSTANCE.setLanguageForPlayer(event.getPlayer(), event.getLocale()); }
@EventHandler public void onLangChange(PlayerLocaleChangeEvent event) { updatePlayer(event.getPlayer(), event.getNewLocale()); }
@EventHandler public void onLocaleChange(PlayerLocaleChangeEvent event) { if (isDeadUUID(event.getPlayer().getUniqueId()) && deadPlayers.get(event.getPlayer().getUniqueId()) != 0) sendTitle(event.getPlayer()); }
@EventHandler public void onLangChange(PlayerLocaleChangeEvent event) { updatePlayer(event.getPlayer(), event.getNewLocale(), HeaderPart.NONE); }