Skip to content

Commit cc3ad71

Browse files
committed
Add bStats
1 parent 6a003af commit cc3ad71

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

pom.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<maven.compiler.source>1.8</maven.compiler.source>
1515
<maven.compiler.target>1.8</maven.compiler.target>
16+
<bstats.version>2.2.1</bstats.version>
1617
</properties>
1718

1819
<build>
@@ -24,6 +25,13 @@
2425
</resource>
2526
</resources>
2627
<plugins>
28+
<plugin>
29+
<artifactId>maven-compiler-plugin</artifactId>
30+
<version>3.8.1</version>
31+
<configuration>
32+
<compilerArgument>-XDignore.symbol.file</compilerArgument>
33+
</configuration>
34+
</plugin>
2735
<plugin>
2836
<artifactId>maven-shade-plugin</artifactId>
2937
<version>3.2.4</version>
@@ -39,6 +47,27 @@
3947
<minmizeJar>false</minmizeJar>
4048
<shadedArtifactAttached>false</shadedArtifactAttached>
4149
<createDependencyReducedPom>false</createDependencyReducedPom>
50+
<relocations>
51+
<relocation>
52+
<pattern>org.bstats</pattern>
53+
<shadedPattern>net.andylizi.haproxydetector.bstats</shadedPattern>
54+
</relocation>
55+
</relocations>
56+
<filters>
57+
<filter>
58+
<artifact>io.netty:*</artifact>
59+
<excludes>
60+
<exclude>META-INF/io.netty.versions.properties</exclude>
61+
<exclude>META-INF/MANIFEST.MF</exclude>
62+
</excludes>
63+
</filter>
64+
<filter>
65+
<artifact>org.bstats:*</artifact>
66+
<excludes>
67+
<exclude>META-INF/MANIFEST.MF</exclude>
68+
</excludes>
69+
</filter>
70+
</filters>
4271
</configuration>
4372
</plugin>
4473
</plugins>
@@ -73,6 +102,18 @@
73102
</exclusions>
74103
</dependency>
75104

105+
<dependency>
106+
<groupId>org.bstats</groupId>
107+
<artifactId>bstats-bukkit</artifactId>
108+
<version>${bstats.version}</version>
109+
</dependency>
110+
111+
<dependency>
112+
<groupId>org.bstats</groupId>
113+
<artifactId>bstats-bungeecord</artifactId>
114+
<version>${bstats.version}</version>
115+
</dependency>
116+
76117
<dependency>
77118
<groupId>net.md-5</groupId>
78119
<artifactId>bungeecord-api</artifactId>
@@ -86,6 +127,7 @@
86127
<version>1.16.2-R0.1-SNAPSHOT</version>
87128
<scope>provided</scope>
88129
</dependency>
130+
89131
<dependency>
90132
<groupId>com.comphenix.protocol</groupId>
91133
<artifactId>ProtocolLib</artifactId>

src/main/java/net/andylizi/haproxydetector/bukkit/BukkitMain.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.comphenix.protocol.reflect.FuzzyReflection;
1111

1212
import org.bukkit.plugin.java.JavaPlugin;
13+
import org.bstats.bukkit.Metrics;
1314

1415
import net.andylizi.haproxydetector.ReflectionUtil;
1516
import static net.andylizi.haproxydetector.ReflectionUtil.sneakyThrow;
@@ -46,6 +47,8 @@ public void onEnable() {
4647
} catch (ReflectiveOperationException e) {
4748
sneakyThrow(e);
4849
}
50+
51+
new Metrics(this, 12604);
4952
}
5053

5154
@Override

src/main/java/net/andylizi/haproxydetector/bungee/BungeeMain.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import net.md_5.bungee.api.config.ListenerInfo;
3838
import net.md_5.bungee.api.plugin.Listener;
3939
import net.md_5.bungee.api.plugin.Plugin;
40+
import org.bstats.bungeecord.Metrics;
4041

4142
import static net.andylizi.haproxydetector.ReflectionUtil.sneakyThrow;
4243

@@ -93,6 +94,8 @@ public void onEnable() {
9394
logger.warning("Proxy protocol is disabled, the plugin may not work correctly!");
9495
}
9596
}
97+
98+
new Metrics(this, 12605);
9699
}
97100

98101
@Override

0 commit comments

Comments
 (0)