Tablist [1.7.10] - Help

Версия Minecraft
1.7.10
API
Forge
Всем привет. Короче столкнулся с небольшой проблемой. Пишу свой мод на обновленный tablist, но не могу понять одну вещь. Как мне с серверной части мода отправить в клиент часть информацию об игроке. То есть я хочу чтобы при заходе игрока на сервер, происходила проверка - какой у него статус в PermissionEx и выводило итог в таб. Но не могу разобраться, как правильно это сделать.
Читал гайды и брал примеры, но все равно вечно пишет в табе игрок. Надеюсь сможете помочь...
 
Решение
1)Ловишь эвент входа игрока на сервер
2) Проверяешь какая у игрока привилегия
3) Отправляешь информацию о привилегии игрока всем другим игрокам
4) Выводишь информацию
@Netrus а пример у вас есть? Просто у меня есть один пример, можете сказать то ли это?


Java:
public class PlayerListener
implements Listener {
    private final TabPlugin plugin;
    private static final ScheduledExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadScheduledExecutor();

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent e) {
        this.onPlayerEntrance();
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        this.onPlayerEntrance();
    }

    public void onPlayerEntrance() {
        EXECUTOR_SERVICE.schedule(() -> {
            ByteBuf out = Unpooled.buffer();
            out.writeByte(1);
            Collection players = this.plugin.getServer().getOnlinePlayers();
            out.writeInt(players.size());
            players.forEach(onlinePlayer -> {
                User user = this.plugin.getLuckPerms().getUserManager().getUser(onlinePlayer.getUniqueId());
                if (user == null) {
                    this.plugin.getLogger().severe(String.format("Player %s not found in LuckPerms!", onlinePlayer.getDisplayName()));
                }
                String primaryGroupName = user.getPrimaryGroup();
                ByteBufUtils.writeUTF8String(out, this.getGroup(primaryGroupName).getPrefix());
                ByteBufUtils.writeUTF8String(out, onlinePlayer.getName());
                ByteBufUtils.writeUTF8String(out, onlinePlayer.getDisplayName());
                ByteBufUtils.writeUTF8String(out, this.getGroup(primaryGroupName).getColor());
                out.writeInt(this.getGroup(primaryGroupName).getPriority());
                out.writeInt(ReflectionUtils.getPing(this.plugin, onlinePlayer));
                ReflectionUtils.serializeGameProfile(this.plugin, out, onlinePlayer);
            });
            byte[] bytes = new byte[out.readableBytes()];
            out.readBytes(bytes);
            players.forEach(player -> player.sendPluginMessage((Plugin)this.plugin, "tabinfo", bytes));
        }, 5L, TimeUnit.SECONDS);
    }

    private GroupInfoModel getGroup(String primaryGroupName) {
        Map<String, GroupInfoModel> groupMap = this.plugin.getConfiguration().getGroupInfoByNameMap();
        return Optional.ofNullable(groupMap.get(primaryGroupName)).orElse(groupMap.get("default"));
    }

    public PlayerListener(TabPlugin plugin) {
        this.plugin = plugin;
    }
}
 
Сверху