Skip to content

Commit

Permalink
+ Added Metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffion committed Feb 16, 2014
1 parent e8d07a5 commit 8a4b4dd
Show file tree
Hide file tree
Showing 3 changed files with 838 additions and 0 deletions.
Binary file modified builds/AdminEye_v0.1.0_ALPHA_B1.jar
Binary file not shown.
26 changes: 26 additions & 0 deletions src/nl/Steffion/AdminEye/AdminEye.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public void onEnable() {
StefsAPI.ConfigHandler
.addDefault(config, "chat.everyone", "&3Everyone");

StefsAPI.ConfigHandler.addDefault(config, "metrics.enabled", true);

// AdminEye default commands.
StefsAPI.CommandHandler.registerCommand(pdfFile.getName(), null, null,
"info", "Displays the plugin's info.", PermissionType.ALL,
Expand Down Expand Up @@ -346,6 +348,30 @@ PermissionType.MODERATOR, new UnbanCommand(),

StefsAPI.enableAPI();

if (config.getFile().getBoolean("metrics.enabled")) {
try {
Metrics metrics = new Metrics(plugin);
metrics.start();
StefsAPI.MessageHandler.buildMessage().addSender("$")
.setMessage("%TAGSending %AMCStats%N to their server!")
.build();
} catch (Exception e) {
StefsAPI.MessageHandler
.buildMessage()
.addSender("$")
.setMessage(
"%TAG%EUnable to send %AMCStats %Eto their server. Something went wrong ;(!")
.build();
}
} else {
StefsAPI.MessageHandler
.buildMessage()
.addSender("$")
.setMessage(
"%TAG%EUnable to send %AMCStats %Eto their server. Is it disabled?")
.build();
}

StefsAPI.MessageHandler
.buildMessage()
.addSender("$")
Expand Down
Loading

0 comments on commit 8a4b4dd

Please sign in to comment.