当前位置: 首页>>代码示例>>Java>>正文


Java CustomTimingsHandler类代码示例

本文整理汇总了Java中org.spigotmc.CustomTimingsHandler的典型用法代码示例。如果您正苦于以下问题:Java CustomTimingsHandler类的具体用法?Java CustomTimingsHandler怎么用?Java CustomTimingsHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CustomTimingsHandler类属于org.spigotmc包,在下文中一共展示了CustomTimingsHandler类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WorldTimingsHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public WorldTimingsHandler(World server) {
    String name = server.worldData.getName() +" - ";

    mobSpawn = new CustomTimingsHandler(name + "mobSpawn");
    doChunkUnload = new CustomTimingsHandler(name + "doChunkUnload");
    doTickPending = new CustomTimingsHandler(name + "doTickPending");
    doTickTiles = new CustomTimingsHandler(name + "doTickTiles");
    doVillages = new CustomTimingsHandler(name + "doVillages");
    doChunkMap = new CustomTimingsHandler(name + "doChunkMap");
    doSounds = new CustomTimingsHandler(name + "doSounds");
    doChunkGC = new CustomTimingsHandler(name + "doChunkGC");
    doPortalForcer = new CustomTimingsHandler(name + "doPortalForcer");
    entityTick = new CustomTimingsHandler(name + "entityTick");
    tileEntityTick = new CustomTimingsHandler(name + "tileEntityTick");
    tileEntityPending = new CustomTimingsHandler(name + "tileEntityPending");
    tracker = new CustomTimingsHandler(name + "tracker");
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:18,代码来源:SpigotTimings.java

示例2: WorldTimingsHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public WorldTimingsHandler(World server) {
    String name = server.worldInfo.getWorldName() +" - ";

    mobSpawn = new CustomTimingsHandler("** " + name + "mobSpawn");
    doChunkUnload = new CustomTimingsHandler("** " + name + "doChunkUnload");
    doTickPending = new CustomTimingsHandler("** " + name + "doTickPending");
    doTickTiles = new CustomTimingsHandler("** " + name + "doTickTiles");
    doVillages = new CustomTimingsHandler("** " + name + "doVillages");
    doChunkMap = new CustomTimingsHandler("** " + name + "doChunkMap");
    doSounds = new CustomTimingsHandler("** " + name + "doSounds");
    doChunkGC = new CustomTimingsHandler("** " + name + "doChunkGC");
    doPortalForcer = new CustomTimingsHandler("** " + name + "doPortalForcer");
    entityTick = new CustomTimingsHandler("** " + name + "entityTick");
    tileEntityTick = new CustomTimingsHandler("** " + name + "tileEntityTick");
    tileEntityPending = new CustomTimingsHandler("** " + name + "tileEntityPending");

    syncChunkLoadTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad");
    syncChunkLoadDataTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad - Data");
    syncChunkLoadStructuresTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Structures");
    syncChunkLoadEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Entities");
    syncChunkLoadTileEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileEntities");
    syncChunkLoadTileTicksTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileTicks");
    syncChunkLoadPostTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Post");


    tracker = new CustomTimingsHandler(name + "tracker");
    doTick = new CustomTimingsHandler(name + "doTick");
    tickEntities = new CustomTimingsHandler(name + "tickEntities");
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:30,代码来源:SpigotTimings.java

示例3: createHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
private static Object createHandler(String name) {
	if (!PAPER_SPIGOT) {
		return new CustomTimingsHandler(name);
	} else {
		try {
			Class<?> clazz = Class.forName("co.aikar.timings.Timings");
			return clazz.getDeclaredMethod("of", Plugin.class, String.class).invoke(null, MapManagerPlugin.instance, name);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}
 
开发者ID:InventivetalentDev,项目名称:MapManager,代码行数:13,代码来源:TimingsHelper.java

示例4: WorldTimingsHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public WorldTimingsHandler(World server) {
    String name = server.worldData.getName() + " - ";

    mobSpawn = new CustomTimingsHandler("** " + name + "mobSpawn");
    doChunkUnload = new CustomTimingsHandler("** " + name + "doChunkUnload");
    doTickPending = new CustomTimingsHandler("** " + name + "doTickPending");
    doTickTiles = new CustomTimingsHandler("** " + name + "doTickTiles");
    doVillages = new CustomTimingsHandler("** " + name + "doVillages");
    doChunkMap = new CustomTimingsHandler("** " + name + "doChunkMap");
    doSounds = new CustomTimingsHandler("** " + name + "doSounds");
    doChunkGC = new CustomTimingsHandler("** " + name + "doChunkGC");
    doPortalForcer = new CustomTimingsHandler("** " + name + "doPortalForcer");
    entityTick = new CustomTimingsHandler("** " + name + "entityTick");
    tileEntityTick = new CustomTimingsHandler("** " + name + "tileEntityTick");
    tileEntityPending = new CustomTimingsHandler("** " + name + "tileEntityPending");

    syncChunkLoadTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad");
    syncChunkLoadDataTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad - Data");
    syncChunkLoadStructuresTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Structures");
    syncChunkLoadEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Entities");
    syncChunkLoadTileEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileEntities");
    syncChunkLoadTileTicksTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileTicks");
    syncChunkLoadPostTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Post");


    tracker = new CustomTimingsHandler(name + "tracker");
    doTick = new CustomTimingsHandler(name + "doTick");
    tickEntities = new CustomTimingsHandler(name + "tickEntities");
}
 
开发者ID:MagicDroidX,项目名称:Brynhildr,代码行数:30,代码来源:Timings.java

示例5: onCommand

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
@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;
}
 
开发者ID:games647,项目名称:LagMonitor,代码行数:36,代码来源:TimingCommand.java

示例6: WorldTimingsHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public WorldTimingsHandler(World server) {
    String name = server.worldInfo.getWorldName() +" - ";

    mobSpawn = new CustomTimingsHandler("** " + name + "mobSpawn");
    doChunkUnload = new CustomTimingsHandler("** " + name + "doChunkUnload");
    doTickPending = new CustomTimingsHandler("** " + name + "doTickPending");
    doTickTiles = new CustomTimingsHandler("** " + name + "doTickTiles");
    doVillages = new CustomTimingsHandler("** " + name + "doVillages");
    doChunkMap = new CustomTimingsHandler("** " + name + "doChunkMap");
    doSounds = new CustomTimingsHandler("** " + name + "doSounds");
    doChunkGC = new CustomTimingsHandler("** " + name + "doChunkGC");
    doPortalForcer = new CustomTimingsHandler("** " + name + "doPortalForcer");
    entityTick = new CustomTimingsHandler("** " + name + "entityTick");
    tileEntityTick = new CustomTimingsHandler("** " + name + "tileEntityTick");
    tileEntityPending = new CustomTimingsHandler("** " + name + "tileEntityPending");

    syncChunkLoadTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad");
    syncChunkLoadDataTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad - Data");
    syncChunkLoadStructuresTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Structures");
    syncChunkLoadEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Entities");
    syncChunkLoadTileEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileEntities");
    syncChunkLoadTileTicksTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileTicks");
    syncChunkLoadPostTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Post");


    tracker = new CustomTimingsHandler(name + "tracker");
    doTick = new CustomTimingsHandler(name + "doTick");
    tickEntities = new CustomTimingsHandler(name + "tickEntities");
    weatherUpdate = new CustomTimingsHandler(name + "weatherUpdate");
    cleanupCache = new CustomTimingsHandler(name + "cleanupCache");
}
 
开发者ID:djoveryde,项目名称:KCauldron,代码行数:32,代码来源:SpigotTimings.java

示例7: WorldTimingsHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public WorldTimingsHandler(World server) {
    String name = server.worldInfo.getWorldName() +" - ";

    mobSpawn = new CustomTimingsHandler(a2s_text + name + "mobSpawn");
    doChunkUnload = new CustomTimingsHandler(a2s_text + name + "doChunkUnload");
    doTickPending = new CustomTimingsHandler(a2s_text + name + "doTickPending");
    doTickTiles = new CustomTimingsHandler(a2s_text + name + "doTickTiles");
    doVillages = new CustomTimingsHandler(a2s_text + name + "doVillages");
    doChunkMap = new CustomTimingsHandler(a2s_text + name + "doChunkMap");
    doSounds = new CustomTimingsHandler(a2s_text + name + "doSounds");
    doChunkGC = new CustomTimingsHandler(a2s_text + name + "doChunkGC");
    doPortalForcer = new CustomTimingsHandler(a2s_text + name + "doPortalForcer");
    entityTick = new CustomTimingsHandler(a2s_text + name + "entityTick");
    tileEntityTick = new CustomTimingsHandler(a2s_text + name + "tileEntityTick");
    tileEntityPending = new CustomTimingsHandler(a2s_text + name + "tileEntityPending");

    syncChunkLoadTimer = new CustomTimingsHandler(a2s_text + name + "syncChunkLoad");
    syncChunkLoadDataTimer = new CustomTimingsHandler(a2s_text + name + "syncChunkLoad - Data");
    syncChunkLoadStructuresTimer = new CustomTimingsHandler(a2s_text + name + "chunkLoad - Structures");
    syncChunkLoadEntitiesTimer = new CustomTimingsHandler(a2s_text + name + "chunkLoad - Entities");
    syncChunkLoadTileEntitiesTimer = new CustomTimingsHandler(a2s_text + name + "chunkLoad - TileEntities");
    syncChunkLoadTileTicksTimer = new CustomTimingsHandler(a2s_text + name + "chunkLoad - TileTicks");
    syncChunkLoadPostTimer = new CustomTimingsHandler(a2s_text + name + "chunkLoad - Post");


    tracker = new CustomTimingsHandler(name + "tracker");
    doTick = new CustomTimingsHandler(name + "doTick");
    tickEntities = new CustomTimingsHandler(name + "tickEntities");
}
 
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:30,代码来源:SpigotTimings.java

示例8: WorldTimingsHandler

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public WorldTimingsHandler(World server) {
    String name = server.worldData.getName() +" - ";

    mobSpawn = new CustomTimingsHandler("** " + name + "mobSpawn");
    doChunkUnload = new CustomTimingsHandler("** " + name + "doChunkUnload");
    doTickPending = new CustomTimingsHandler("** " + name + "doTickPending");
    doTickTiles = new CustomTimingsHandler("** " + name + "doTickTiles");
    doVillages = new CustomTimingsHandler("** " + name + "doVillages");
    doChunkMap = new CustomTimingsHandler("** " + name + "doChunkMap");
    doSounds = new CustomTimingsHandler("** " + name + "doSounds");
    doChunkGC = new CustomTimingsHandler("** " + name + "doChunkGC");
    doPortalForcer = new CustomTimingsHandler("** " + name + "doPortalForcer");
    entityTick = new CustomTimingsHandler("** " + name + "entityTick");
    tileEntityTick = new CustomTimingsHandler("** " + name + "tileEntityTick");
    tileEntityPending = new CustomTimingsHandler("** " + name + "tileEntityPending");

    syncChunkLoadTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad");
    syncChunkLoadDataTimer = new CustomTimingsHandler("** " + name + "syncChunkLoad - Data");
    syncChunkLoadStructuresTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Structures");
    syncChunkLoadEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Entities");
    syncChunkLoadTileEntitiesTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileEntities");
    syncChunkLoadTileTicksTimer = new CustomTimingsHandler("** " + name + "chunkLoad - TileTicks");
    syncChunkLoadPostTimer = new CustomTimingsHandler("** " + name + "chunkLoad - Post");


    tracker = new CustomTimingsHandler(name + "tracker");
    doTick = new CustomTimingsHandler(name + "doTick");
    tickEntities = new CustomTimingsHandler(name + "tickEntities");
}
 
开发者ID:pvginkel,项目名称:Tweakkit-Server,代码行数:30,代码来源:SpigotTimings.java

示例9: SpigotTiming

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
SpigotTiming(String name) {
    super();
    this.timing = new CustomTimingsHandler(name);
}
 
开发者ID:aikar,项目名称:minecraft-timings,代码行数:5,代码来源:SpigotTiming.java

示例10: executeSpigotTimings

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public void executeSpigotTimings(CommandSender sender, String[] args) {
    if ( "on".equals( args[0] ) )
    {
        ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true );
        CustomTimingsHandler.reload();
        sender.sendMessage( "Enabled Timings & Reset" );
        return;
    } else if ( "off".equals( args[0] ) )
    {
        ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false );
        sender.sendMessage( "Disabled Timings" );
        return;
    }

    if ( !Bukkit.getPluginManager().useTimings() )
    {
        sender.sendMessage( "Please enable timings by typing /timings on" );
        return;
    }

    boolean paste = "paste".equals( args[0] );
    if ("reset".equals(args[0])) {
        CustomTimingsHandler.reload();
        sender.sendMessage("Timings reset");
    } else if ("merged".equals(args[0]) || "report".equals(args[0]) || paste) {
        long sampleTime = System.nanoTime() - timingStart;
        int index = 0;
        File timingFolder = new File("timings");
        timingFolder.mkdirs();
        File timings = new File(timingFolder, "timings.txt");
        ByteArrayOutputStream bout = ( paste ) ? new ByteArrayOutputStream() : null;
        while (timings.exists()) timings = new File(timingFolder, "timings" + (++index) + ".txt");
        PrintStream fileTimings = null;
        try {
            fileTimings = ( paste ) ? new PrintStream( bout ) : new PrintStream( timings );

            CustomTimingsHandler.printTimings(fileTimings);
            fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" );

            if ( paste )
            {
                new PasteThread( sender, bout ).start();
                return;
            }

            sender.sendMessage("Timings written to " + timings.getPath());
            sender.sendMessage( "Paste contents of file into form at http://www.spigotmc.org/go/timings to read results." );

        } catch (IOException e) {
        } finally {
            if (fileTimings != null) {
                fileTimings.close();
            }
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:57,代码来源:TimingsCommand.java

示例11: executeSpigotTimings

import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
public void executeSpigotTimings(CommandSender sender, String[] args) {
    if ( "on".equals( args[0] ) )
    {
        ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true );
        CustomTimingsHandler.reload();
        sender.sendMessage( "Enabled Timings & Reset" );
        return;
    } else if ( "off".equals( args[0] ) )
    {
        ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false );
        sender.sendMessage( "Disabled Timings" );
        return;
    }

    if ( !Bukkit.getPluginManager().useTimings() )
    {
        sender.sendMessage( "Please enable timings by typing /timings on" );
        return;
    }

    boolean paste = "paste".equals( args[0] );
    if ("reset".equals(args[0])) {
        CustomTimingsHandler.reload();
        sender.sendMessage("Timings reset");
    } else if ("merged".equals(args[0]) || "report".equals(args[0]) || paste) {
        long sampleTime = System.nanoTime() - timingStart;
        int index = 0;
        File timingFolder = new File("timings");
        timingFolder.mkdirs();
        File timings = new File(timingFolder, "timings.txt");
        ByteArrayOutputStream bout = ( paste ) ? new ByteArrayOutputStream() : null;
        while (timings.exists()) timings = new File(timingFolder, "timings" + (++index) + ".txt");
        PrintStream fileTimings = null;
        try {
            fileTimings = ( paste ) ? new PrintStream( bout ) : new PrintStream( timings );

            CustomTimingsHandler.printTimings(fileTimings);
            fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" );

            fileTimings.println( "<spigotConfig>" );
            fileTimings.println( Bukkit.spigot().getConfig().saveToString() );
            fileTimings.println( "</spigotConfig>" );

            if ( paste )
            {
                new PasteThread( sender, bout ).start();
                return;
            }

            sender.sendMessage("Timings written to " + timings.getPath());
            sender.sendMessage( "Paste contents of file into form at http://www.spigotmc.org/go/timings to read results." );

        } catch (IOException e) {
        } finally {
            if (fileTimings != null) {
                fileTimings.close();
            }
        }
    }
}
 
开发者ID:SpigotMC,项目名称:Spigot-API,代码行数:61,代码来源:TimingsCommand.java


注:本文中的org.spigotmc.CustomTimingsHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。