Skip to content

Commit fcf5e3b

Browse files
committed
Added Bstats metrics.
1 parent 68bdc61 commit fcf5e3b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

pom.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>pw.hwk</groupId>
55
<artifactId>ServerTutorial</artifactId>
6-
<version>3.1.0</version>
6+
<version>3.1.1</version>
77

88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -40,6 +40,12 @@
4040
<version>v1.12.2-R2.2</version>
4141
<scope>compile</scope>
4242
</dependency>
43+
<dependency>
44+
<groupId>org.bstats</groupId>
45+
<artifactId>bstats-bukkit</artifactId>
46+
<version>1.2</version>
47+
<scope>compile</scope>
48+
</dependency>
4349

4450
</dependencies>
4551

@@ -65,6 +71,11 @@
6571
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
6672
</repository>
6773

74+
<!-- bStats Repo -->
75+
<repository>
76+
<id>bstats-repo</id>
77+
<url>http://repo.bstats.org/content/repositories/releases/</url>
78+
</repository>
6879
</repositories>
6980
<distributionManagement>
7081
<repository>
@@ -153,6 +164,12 @@
153164
<exclude>org.bukkit:bukkit</exclude>
154165
</excludes>
155166
</artifactSet>
167+
<relocations>
168+
<relocation>
169+
<pattern>org.bstats</pattern>
170+
<shadedPattern>pw.hwk.bstats</shadedPattern>
171+
</relocation>
172+
</relocations>
156173
</configuration>
157174
</execution>
158175
</executions>

src/main/java/pw/hwk/tutorial/ServerTutorial.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.Map;
2121
import java.util.UUID;
2222
import java.util.logging.Level;
23+
import org.bstats.bukkit.Metrics;
2324
import pw.hwk.tutorial.data.TempPlayerData;
2425
import pw.hwk.tutorial.util.Base64Serialize;
2526

@@ -43,6 +44,9 @@ public void onEnable() {
4344
this.getCommand("tutorial").setExecutor(new TutorialMainCommand());
4445
this.saveDefaultConfig();
4546

47+
if (this.getConfig().getBoolean("metrics", true)) {
48+
Metrics metrics = new Metrics(this);
49+
}
4650
DataLoading.getDataLoading().loadData();
4751
DataLoading.getDataLoading().loadPlayerData();
4852
DataLoading.getDataLoading().loadTempData();

0 commit comments

Comments
 (0)