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


Java Metrics.start方法代码示例

本文整理汇总了Java中org.mcstats.Metrics.start方法的典型用法代码示例。如果您正苦于以下问题:Java Metrics.start方法的具体用法?Java Metrics.start怎么用?Java Metrics.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mcstats.Metrics的用法示例。


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

示例1: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
public void onEnable() {
	getConfig().options().copyDefaults(true);
	saveDefaultConfig();
	this.pluginconfig = new Config(this,getConfig());

	this.saveBlocks();
	this.saveMobs();
	this.saveTools();
	getBlocks();
	getMobs();
	getTools();

	/* enable metrics */
	if (pluginconfig.isMetrics()) {
		try {
			Metrics metrics = new Metrics(this);
			metrics.start();
		} catch (IOException e) {
			// Failed to submit the stats :-(
			MessageUtil.sendConsoleMessage("Failed to start Metrics!");
		}

	}


}
 
开发者ID:Ratismal,项目名称:Exchequer,代码行数:27,代码来源:Exchequer.java

示例2: setupMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
/**
 * Setups metrics
 *
 * @throws IOException if fails
 */
private void setupMetrics() throws IOException {
	Metrics metrics = new Metrics(this);
	Metrics.Graph guildsAndUsersGraph = metrics.createGraph("Guilds and users");

	guildsAndUsersGraph.addPlotter(new Metrics.Plotter("Guilds") {
		@Override
		public int getValue() {
			return getGuildManager().getGuilds().size();
		}
	});

	guildsAndUsersGraph.addPlotter(new Metrics.Plotter("Users") {
		@Override
		public int getValue() {
			return getPlayerManager().getPlayers().size();
		}
	});

	metrics.start();
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:26,代码来源:NovaGuilds.java

示例3: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable() {
    saveDefaultConfig();
    plugin = this;
    DEListener listener = new DEListener();
    getServer().getPluginManager().registerEvents(listener, plugin);
    boolean isBroadcast = getConfig().getBoolean("config.broadcast.use");
    if (isBroadcast) {
        DEThread deThread = new DEThread();
        deThread.start();
    }
    Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "梦梦家高性能服务器出租");
    Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "淘宝店 http://shop105595113.taobao.com");
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:caoli5288,项目名称:DoubleExp,代码行数:21,代码来源:DEMain.java

示例4: setupMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
private void setupMetrics()
{
    if (getConfig().getBoolean("MetricsEnabled"))
    {
        try
        {
            Metrics metrics = new Metrics(this);
            metrics.start();
            getLogger().info("Metrics connection established.");
        }
        catch (IOException e)
        {
            getLogger().severe("Failed to connect to mcstats.org!");
        }
    }
}
 
开发者ID:ColonelHedgehog,项目名称:Equestrian-Dash,代码行数:17,代码来源:EquestrianDash.java

示例5: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable() {
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        // Failed to submit the stats :-(
    }
    System.out.println(getServer().getBukkitVersion());

    LoadConfig();
}
 
开发者ID:loveyanbei,项目名称:MazePlugin,代码行数:13,代码来源:MazePlugin.java

示例6: initMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
public void initMetrics() throws IOException {
    Metrics metrics = new Metrics(this);

    Metrics.Graph enabledModes = metrics.createGraph("Enabled Services");

    enabledModes.addPlotter(new Metrics.Plotter("Google Drive") {
        @Override
        public int getValue() {
            return Config.isGoogleEnabled() ? 1 : 0;
        }
    });

    enabledModes.addPlotter(new Metrics.Plotter("OneDrive") {
        @Override
        public int getValue() {
            return Config.isOnedriveEnabled() ? 1 : 0;
        }
    });

    enabledModes.addPlotter(new Metrics.Plotter("FTP") {
        @Override
        public int getValue() {
            return Config.isFtpEnabled() ? 1 : 0;
        }
    });

    enabledModes.addPlotter(new Metrics.Plotter("None") {
        @Override
        public int getValue() {
            return Config.isOnedriveEnabled() || Config.isGoogleEnabled() || Config.isFtpEnabled() ? 0 : 1;
        }
    });

    metrics.start();
}
 
开发者ID:Ratismal,项目名称:DriveBackup,代码行数:36,代码来源:DriveBackup.java

示例7: startMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
protected void startMetrics () {
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        getLogger().warning("Failed to start metrics.");
    }
}
 
开发者ID:jmshal,项目名称:meloooncensor,代码行数:9,代码来源:MelooonCensor.java

示例8: setupMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
/**
 * Automatically sets up MC-Stats Metrics for you
 */ 
public void setupMetrics() {
	try {
		Metrics metrics = new Metrics(plugin);
		metrics.start();
	} catch (IOException e) {
	}
}
 
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:11,代码来源:PluginUtils.java

示例9: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable() {
	getOrRegisterDownloadPerm();
	
	getServer().getPluginManager().registerEvents(this, this);
	
	try {
		class StringPlotter extends Plotter {
			public StringPlotter(String str) {
				super(str);
			}
			
			@Override
			public int getValue() {
				return 1;
			}
		}
		
		Metrics metrics = new Metrics(this);
		
		Graph factionsVersionGraph = metrics.createGraph("factionsVersion");
		String factionsVersion = getProvidingPlugin(Factions.class)
				.getDescription().getFullName();
		factionsVersionGraph.addPlotter(new StringPlotter(factionsVersion));
		
		Graph massiveCoreVersionGraph = metrics.createGraph("massiveCoreVersion");
		String massiveCoreVersion = getProvidingPlugin(MassiveCore.class)
				.getDescription().getFullName();
		massiveCoreVersionGraph.addPlotter(new StringPlotter(massiveCoreVersion));
		
		Graph wdlcVersionGraph = metrics.createGraph("wdlcompanionVersion");
		String wdlcVersion = getProvidingPlugin(IRangeProducer.class)
				.getDescription().getFullName();
		wdlcVersionGraph.addPlotter(new StringPlotter(wdlcVersion));
		
		metrics.start();
	} catch (Exception e) {
		getLogger().warning("Failed to start PluginMetrics :(");
	}
}
 
开发者ID:Pokechu22,项目名称:WDLCompanion-Factions,代码行数:41,代码来源:FactionsSupportPlugin.java

示例10: initMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
public void initMetrics() {
    if (getConfig().getBoolean("enable-metrics")) {
        try {
            Metrics metrics = new Metrics(this);
            metrics.start();
        } catch (IOException ex) {
            ex.printStackTrace();
            getLogger().severe("Failed to enable Plugin Metrics!");
        }
    }
}
 
开发者ID:caseif,项目名称:Steel,代码行数:12,代码来源:SteelMain.java

示例11: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable() {

    this.saveDefaultConfig();

    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        // Failed to submit the stats :-(
    }
    getCommand("whoWas").setExecutor(new WhoWasCommand(this));
    // Waiting for plugin id
    runUpdater();
}
 
开发者ID:Aaron1011,项目名称:WhoWas,代码行数:16,代码来源:BukkitPlugin.java

示例12: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable(){
    if (!getConfig().getBoolean("enabled")){
        getLogger().severe("The plugin enabled status has not been set to true in the config, disabling...");
        setEnabled(false);
        return;
    }

    PluginManager pluginManager = Bukkit.getPluginManager();
    pluginManager.registerEvents(new UUIDCompatibilityListener(this), this);
    pluginManager.registerEvents(this, this);

    PluginCommand command = getCommand("uuidcompatibility");
    MainCommand mainCommand = new MainCommand(this);
    command.setExecutor(mainCommand);
    command.setTabCompleter(mainCommand);

    importData();

    try {
        metrics = new Metrics(this);

        Metrics.Graph storedGraph = metrics.createGraph("Player UUIDs <-> Names Stored");
        storedGraph.addPlotter(new Metrics.Plotter() {
            @Override
            public int getValue() {
                return getNameMappingsWrapper().getConfig().getKeys(false).size();
            }
        });

        metrics.start();
    } catch (IOException e){}
}
 
开发者ID:iKeirNez,项目名称:UUIDCompatibility,代码行数:34,代码来源:UUIDCompatibility.java

示例13: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable() {
	this.saveDefaultConfig();
	getConfig().options().copyDefaults(true);
	saveConfig();
	if (!setupPermissions()) {
		if (getConfig().getBoolean("require-vault")) {
			getLogger().severe("Vault not found. Shutting down...");
			getServer().getPluginManager().disablePlugin(this);
			return;
		} else {
			getLogger().warning("Vault not found. All players will have permission to execute scripts!");
		}
		hasPerms = false;
	} else {
		hasPerms = true;
	}
	try {
		Metrics metrics = new Metrics(this);
		Graph VersionDemographics = metrics.createGraph("Version Demographics");
		VersionDemographics.addPlotter(new Metrics.Plotter(getDescription().getVersion()) {

			@Override
			public int getValue() {
				return 1;
			}

		});
		metrics.start();
	} catch (IOException e) {
		//Metrics not available :-(
	}
	this.getCommand("se").setExecutor(new CommandExecutor(this));
}
 
开发者ID:lights0123,项目名称:ScriptExec,代码行数:35,代码来源:ScriptExec.java

示例14: setupMetrics

import org.mcstats.Metrics; //导入方法依赖的package包/类
private void setupMetrics() {
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException ignored) {
    }
}
 
开发者ID:WorldCretornica,项目名称:PlotMe-DefaultGenerator,代码行数:8,代码来源:BukkitDefaultGenerator.java

示例15: onEnable

import org.mcstats.Metrics; //导入方法依赖的package包/类
@Override
public void onEnable() {
	log.info(prefixc + "Registering events...");
	this.getServer().getPluginManager().registerEvents(this, this);
	log.info(prefixc + "Registering events done!");
	log.info(prefixc + "Sending stats to MCStats...");
	try {
		Metrics metrics = new Metrics(this);
		metrics.start();
		log.info(prefixc + "Sending stats to MCStats done!");
	} catch (IOException e) {
		log.info(prefixc + "Sending stats to MCStats failed!");
	}
	log.info(prefixc + "enabled!");
}
 
开发者ID:Zandor300,项目名称:LavaWalk,代码行数:16,代码来源:LavaWalk.java


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