Added metrics-support

This commit is contained in:
Frank Baumann 2014-03-17 16:02:22 +01:00
parent 47f8007817
commit 472addcbdd
2 changed files with 60 additions and 16 deletions

39
pom.xml
View File

@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dre</groupId>
@ -33,10 +34,30 @@
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>org.mcstats</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
@ -63,9 +84,14 @@
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
</repository>
</repositories>
<dependencies>
<dependencies>
<!-- Provided by third-party -->
<dependency>
<groupId>org.bukkit</groupId>
@ -89,5 +115,12 @@
<scope>compile</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mcstats</groupId>
<artifactId>metrics</artifactId>
<version>R6</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -13,7 +13,6 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.ConfigurationSection;
import org.apache.commons.lang.math.NumberUtils;
import org.bukkit.event.HandlerList;
import org.bukkit.Bukkit;
import org.bukkit.World;
@ -22,6 +21,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.mcstats.Metrics;
import com.dre.brewery.listeners.*;
@ -50,6 +50,9 @@ public class P extends JavaPlugin {
readConfig();
readData();
// Setup Metrics
setupMetrics();
// Load LanguageReader
languageReader = new LanguageReader(new File(p.getDataFolder(), "languages/" + language + ".yml"));
@ -103,6 +106,14 @@ public class P extends JavaPlugin {
this.log(this.getDescription().getName() + " disabled!");
}
public void setupMetrics() {
try {
Metrics metrics = new Metrics(this);
metrics.start();
} catch (IOException e) {
}
}
public void reload(CommandSender sender) {
// clear all existent config Data
BIngredients.possibleIngredients.clear();