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

59
pom.xml
View File

@ -1,14 +1,15 @@
<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>
<artifactId>brewery</artifactId>
<version>1.1.1</version>
<name>Brewery</name>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<!-- Static resources -->
<resource>
@ -23,7 +24,7 @@
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@ -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>
@ -45,7 +66,7 @@
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/artifactory/repo/</url>
@ -54,7 +75,7 @@
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<repository>
<id>dre-repo</id>
<url>http://server.die-reiche-erethons.com/maven2</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>
@ -73,7 +99,7 @@
<version>1.7.2-R0.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
@ -81,7 +107,7 @@
<scope>compile</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.dre</groupId>
<artifactId>managerxl</artifactId>
@ -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.*;
@ -49,7 +49,10 @@ public class P extends JavaPlugin {
readConfig();
readData();
// Setup Metrics
setupMetrics();
// Load LanguageReader
languageReader = new LanguageReader(new File(p.getDataFolder(), "languages/" + language + ".yml"));
@ -102,7 +105,15 @@ 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();