Search in sources :

Example 1 with PlayersInstance

use of com.kahzerx.kahzerxmod.profiler.instances.PlayersInstance in project KahzerxMod by otakucraft.

the class PlayersProfiler method onTick.

@Override
public void onTick(MinecraftServer server, String id) {
    List<PlayersInstance> playerList = new ArrayList<>();
    for (ServerWorld world : server.getWorlds()) {
        for (ServerPlayerEntity player : world.getPlayers()) {
            playerList.add(new PlayersInstance(player.getName().getString(), player.getUuidAsString(), world.getRegistryKey().getValue().getPath(), player.getX(), player.getY(), player.getZ()));
        }
    }
    playerList.add(new PlayersInstance("", "", "", 0.0D, 0.0D, 0.0D));
    this.addResult(server.getTicks(), new ProfilerResult("online_players", id, playerList));
}
Also used : ServerWorld(net.minecraft.server.world.ServerWorld) ArrayList(java.util.ArrayList) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity) PlayersInstance(com.kahzerx.kahzerxmod.profiler.instances.PlayersInstance) ProfilerResult(com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult)

Aggregations

PlayersInstance (com.kahzerx.kahzerxmod.profiler.instances.PlayersInstance)1 ProfilerResult (com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult)1 ArrayList (java.util.ArrayList)1 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)1 ServerWorld (net.minecraft.server.world.ServerWorld)1