Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit f31b0a9

Browse files
committed
Metrics.
I'm curious to see the use of it.
1 parent b1c4865 commit f31b0a9

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<id>ess-repo</id>
2424
<url>http://repo.ess3.net/content/groups/essentials</url>
2525
</repository>
26+
<repository>
27+
<id>Plugin Metrics</id>
28+
<url>http://repo.mcstats.org/content/repositories/public</url>
29+
</repository>
2630
</repositories>
2731
<dependencies>
2832
<dependency>
@@ -35,6 +39,12 @@
3539
<artifactId>Essentials</artifactId>
3640
<version>2.14-SNAPSHOT</version>
3741
</dependency>
42+
<dependency>
43+
<groupId>org.mcstats.bukkit</groupId>
44+
<artifactId>metrics</artifactId>
45+
<version>R8-SNAPSHOT</version>
46+
<scope>compile</scope>
47+
</dependency>
3848
</dependencies>
3949
<distributionManagement>
4050
<repository>
@@ -61,6 +71,32 @@
6171
<target>1.7</target>
6272
</configuration>
6373
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-shade-plugin</artifactId>
77+
<version>2.3</version>
78+
<configuration>
79+
<artifactSet>
80+
<includes>
81+
<include>org.mcstats.*:*</include>
82+
</includes>
83+
</artifactSet>
84+
<relocations>
85+
<relocation>
86+
<pattern>org.mcstats</pattern>
87+
<shadedPattern>ca.jamiesinn.trailgui.metrics</shadedPattern>
88+
</relocation>
89+
</relocations>
90+
</configuration>
91+
<executions>
92+
<execution>
93+
<phase>package</phase>
94+
<goals>
95+
<goal>shade</goal>
96+
</goals>
97+
</execution>
98+
</executions>
99+
</plugin>
64100
</plugins>
65101
<resources>
66102
<resource>

src/main/java/ca/jamiesinn/trailgui/TrailGUI.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
import org.bukkit.plugin.Plugin;
1212
import org.bukkit.plugin.PluginManager;
1313
import org.bukkit.plugin.java.JavaPlugin;
14+
import org.mcstats.Metrics;
1415

16+
import java.io.IOException;
1517
import java.util.HashMap;
1618
import java.util.List;
1719
import java.util.Map;
@@ -45,6 +47,14 @@ public void onEnable()
4547
getCommand("trailgui").setExecutor(new CommandTrailGUI(this));
4648
plugin = this;
4749
load();
50+
try
51+
{
52+
Metrics metrics = new Metrics(this);
53+
metrics.start();
54+
}
55+
catch (IOException ignored)
56+
{
57+
}
4858
}
4959

5060
public void hookEss()
@@ -114,7 +124,8 @@ else if (trailTypeSection.getBoolean("is_effect", false))
114124
{
115125
trailTypes.put(trailTypeSection.getName(), new NormalTrail(trailTypeSection));
116126
}
117-
} catch (Exception ex)
127+
}
128+
catch (Exception ex)
118129
{
119130
getLogger().warning("Failed to load '" + trailTypeSection.getName() + "'. Error: " + ex.getMessage());
120131
}

0 commit comments

Comments
 (0)