Skip to content

Commit

Permalink
Add bStats
Browse files Browse the repository at this point in the history
  • Loading branch information
andylizi committed Aug 26, 2021
1 parent 6a003af commit cc3ad71
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
42 changes: 42 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<bstats.version>2.2.1</bstats.version>
</properties>

<build>
Expand All @@ -24,6 +25,13 @@
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
Expand All @@ -39,6 +47,27 @@
<minmizeJar>false</minmizeJar>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>net.andylizi.haproxydetector.bstats</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>io.netty:*</artifact>
<excludes>
<exclude>META-INF/io.netty.versions.properties</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
<filter>
<artifact>org.bstats:*</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -73,6 +102,18 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>${bstats.version}</version>
</dependency>

<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bungeecord</artifactId>
<version>${bstats.version}</version>
</dependency>

<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
Expand All @@ -86,6 +127,7 @@
<version>1.16.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.comphenix.protocol.reflect.FuzzyReflection;

import org.bukkit.plugin.java.JavaPlugin;
import org.bstats.bukkit.Metrics;

import net.andylizi.haproxydetector.ReflectionUtil;
import static net.andylizi.haproxydetector.ReflectionUtil.sneakyThrow;
Expand Down Expand Up @@ -46,6 +47,8 @@ public void onEnable() {
} catch (ReflectiveOperationException e) {
sneakyThrow(e);
}

new Metrics(this, 12604);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import org.bstats.bungeecord.Metrics;

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

Expand Down Expand Up @@ -93,6 +94,8 @@ public void onEnable() {
logger.warning("Proxy protocol is disabled, the plugin may not work correctly!");
}
}

new Metrics(this, 12605);
}

@Override
Expand Down

0 comments on commit cc3ad71

Please sign in to comment.