Skip to content

Commit

Permalink
Add Plugin Metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jyhsu2000 committed Jun 11, 2016
1 parent dccd908 commit 7ee73a3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties


### Java ###
Expand All @@ -72,4 +75,4 @@ release.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*.MF
*.MF
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ You don't need to know how to craft. All you need to know is how it will looks l
v1.4.4 (for 1.8.x, 1.9.x)
- Optimize code
- Prevent "Title cannot be longer than 32 characters" exception
- Add Plugin Metrics

v1.4.3 (for 1.8.x, 1.9.x)
- Add French(fr) translation (Thanks [RedNesto](https://github.com/RedNesto))
Expand Down Expand Up @@ -172,6 +173,7 @@ v1.0 (for 1.8)
v1.4.4 (for 1.8.x, 1.9.x)
- 優化程式碼
- 防止「Title cannot be longer than 32 characters」例外
- 新增 Plugin Metrics

v1.4.3 (for 1.8.x, 1.9.x)
- 新增法文(fr)翻譯(感謝 [RedNesto](https://github.com/RedNesto)
Expand Down
40 changes: 39 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,40 @@
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>tw.kid7.BannerMaker</groupId>
<groupId>tw.kid7</groupId>
<artifactId>BannerMaker</artifactId>
<version>1.4.4</version>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<artifactSet>
<includes>
<include>org.mcstats.*:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.mcstats</pattern>
<shadedPattern>tw.kid7.BannerMaker</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<properties>
Expand All @@ -27,6 +55,10 @@
<id>vault-repo</id>
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
</repository>
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
</repository>
</repositories>

<dependencies>
Expand All @@ -43,6 +75,12 @@
<version>1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mcstats.bukkit</groupId>
<artifactId>metrics</artifactId>
<version>R8-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
9 changes: 9 additions & 0 deletions src/main/java/tw/kid7/BannerMaker/BannerMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.mcstats.Metrics;
import tw.kid7.BannerMaker.configuration.ConfigManager;
import tw.kid7.BannerMaker.configuration.DefaultConfig;
import tw.kid7.BannerMaker.configuration.Language;
Expand All @@ -13,6 +14,7 @@
import tw.kid7.BannerMaker.util.MessageUtil;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

Expand Down Expand Up @@ -48,6 +50,13 @@ public void onEnable() {
}
//Reload
reload();
//Plugin Metrics
try {
Metrics metrics = new Metrics(this);
metrics.start();
} catch (IOException e) {
// Failed to submit the stats :-(
}
}

@Override
Expand Down

0 comments on commit 7ee73a3

Please sign in to comment.