Java 类org.bukkit.command.defaults.TimingsCommand 实例源码

项目:Uranium    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:ThermosRebased    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:LagMonitor    文件:TimingCommand.java   
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!isAllowed(sender, command)) {
        sender.sendMessage(org.bukkit.ChatColor.DARK_RED + "Not whitelisted");
        return true;
    }

    if (!Bukkit.getPluginManager().useTimings()) {
        sender.sendMessage(ChatColor.DARK_RED + "The server deactivated timing reports");
        sender.sendMessage(ChatColor.DARK_RED + "Go to bukkit.yml and activate plugin-profiling");
        return true;
    }

    //paperspigot moved to class to package co.aikar.timings
    try {
        Class.forName("org.bukkit.command.defaults.TimingsCommand");
    } catch (ClassNotFoundException e) {
        sender.sendMessage(ChatColor.DARK_RED + "You're using a new Timings version on your server system");
        sender.sendMessage(ChatColor.DARK_RED + "Please use the experimental command /paper");
    }

    //place sampleTime here to be very accurate
    long sampleTime = System.nanoTime() - TimingsCommand.timingStart;
    Queue<CustomTimingsHandler> handlers = Reflection.getField(CustomTimingsHandler.class, "HANDLERS", Queue.class)
            .get(null);

    List<BaseComponent[]> lines = Lists.newArrayList();
    sendParsedOutput(handlers, lines, sampleTime);

    Pagination pagination = new Pagination("Paper Timings", lines);
    pagination.send(sender);

    this.plugin.getPaginations().put(sender, pagination);
    return true;
}
项目:Thermos    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:KCauldron    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:CauldronGit    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:Cauldron-Old    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:Cauldron-Reloaded    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:FFoKC    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:LagMonitor    文件:TimingCommand.java   
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!isAllowed(sender, command)) {
        sender.sendMessage(org.bukkit.ChatColor.DARK_RED + "Not whitelisted");
        return true;
    }

    if (!Bukkit.getPluginManager().useTimings()) {
        sender.sendMessage(ChatColor.DARK_RED + "The server deactivated timing reports");
        sender.sendMessage(ChatColor.DARK_RED + "Go to bukkit.yml and activate plugin-profiling");
        return true;
    }

    //paperspigot moved to class to package co.aikar.timings
    try {
        Class.forName("org.bukkit.command.defaults.TimingsCommand");
    } catch (ClassNotFoundException e) {
        sender.sendMessage(ChatColor.DARK_RED + "You're using a new Timings version on your server system");
        sender.sendMessage(ChatColor.DARK_RED + "Please use the experimental command /paper");
    }

    //place sampleTime here to be very accurate
    long sampleTime = System.nanoTime() - TimingsCommand.timingStart;
    Queue<CustomTimingsHandler> handlers = Reflection.getField(CustomTimingsHandler.class, "HANDLERS", Queue.class)
            .get(null);

    List<BaseComponent[]> lines = Lists.newArrayList();
    sendParsedOutput(handlers, lines, sampleTime);

    Pagination pagination = new Pagination("Paper Timings", lines);
    pagination.send(sender);

    this.plugin.getPaginations().put(sender, pagination);
    return true;
}
项目:Cauldron    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:Spigot-API    文件:CustomTimingsHandler.java   
/**
 * Resets all timings.
 */
public static void reload()
{
    if ( Bukkit.getPluginManager().useTimings() )
    {
        for ( CustomTimingsHandler timings : HANDLERS )
        {
            timings.reset();
        }
    }
    TimingsCommand.timingStart = System.nanoTime();
}
项目:ExilePearl    文件:TestCommandMap.java   
private void setDefaultCommands() {
    register("bukkit", new VersionCommand("version"));
    register("bukkit", new ReloadCommand("reload"));
    register("bukkit", new PluginsCommand("plugins"));
    register("bukkit", new TimingsCommand("timings"));
}