本文整理汇总了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!");
}
}
}
示例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();
}
示例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();
}
}
示例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!");
}
}
}
示例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();
}
示例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();
}
示例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.");
}
}
示例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) {
}
}
示例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 :(");
}
}
示例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!");
}
}
}
示例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();
}
示例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){}
}
示例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));
}
示例14: setupMetrics
import org.mcstats.Metrics; //导入方法依赖的package包/类
private void setupMetrics() {
try {
Metrics metrics = new Metrics(this);
metrics.start();
} catch (IOException ignored) {
}
}
示例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!");
}