Search in sources :

Example 1 with Dimension

use of meteordevelopment.meteorclient.utils.world.Dimension in project meteor-client by MeteorDevelopment.

the class LogoutSpots method onTick.

@EventHandler
private void onTick(TickEvent.Post event) {
    if (mc.getNetworkHandler().getPlayerList().size() != lastPlayerList.size()) {
        for (PlayerListEntry entry : lastPlayerList) {
            if (mc.getNetworkHandler().getPlayerList().stream().anyMatch(playerListEntry -> playerListEntry.getProfile().equals(entry.getProfile())))
                continue;
            for (PlayerEntity player : lastPlayers) {
                if (player.getUuid().equals(entry.getProfile().getId())) {
                    add(new Entry(player));
                }
            }
        }
        lastPlayerList.clear();
        lastPlayerList.addAll(mc.getNetworkHandler().getPlayerList());
        updateLastPlayers();
    }
    if (timer <= 0) {
        updateLastPlayers();
        timer = 10;
    } else {
        timer--;
    }
    Dimension dimension = PlayerUtils.getDimension();
    if (dimension != lastDimension)
        players.clear();
    lastDimension = dimension;
}
Also used : PlayerListEntry(net.minecraft.client.network.PlayerListEntry) PlayerListEntry(net.minecraft.client.network.PlayerListEntry) Dimension(meteordevelopment.meteorclient.utils.world.Dimension) PlayerEntity(net.minecraft.entity.player.PlayerEntity) EventHandler(meteordevelopment.orbit.EventHandler)

Example 2 with Dimension

use of meteordevelopment.meteorclient.utils.world.Dimension in project meteor-client by MeteorDevelopment.

the class Search method onPostTick.

@EventHandler
private void onPostTick(TickEvent.Post event) {
    Dimension dimension = PlayerUtils.getDimension();
    if (lastDimension != dimension)
        onActivate();
    lastDimension = dimension;
}
Also used : Dimension(meteordevelopment.meteorclient.utils.world.Dimension) EventHandler(meteordevelopment.orbit.EventHandler)

Aggregations

Dimension (meteordevelopment.meteorclient.utils.world.Dimension)2 EventHandler (meteordevelopment.orbit.EventHandler)2 PlayerListEntry (net.minecraft.client.network.PlayerListEntry)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1