本文整理汇总了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");
}
示例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");
}
示例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);
}
}
}
示例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");
}
示例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;
}
示例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");
}
示例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");
}
示例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");
}
示例9: SpigotTiming
import org.spigotmc.CustomTimingsHandler; //导入依赖的package包/类
SpigotTiming(String name) {
super();
this.timing = new CustomTimingsHandler(name);
}
示例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();
}
}
}
}
示例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();
}
}
}
}