From ea708b3a5566113d4edf5ea45cd6f0aac37bc0ca Mon Sep 17 00:00:00 2001
From: Minecon724 <git@m724.eu>
Date: Sun, 22 Sep 2024 14:31:37 +0200
Subject: [PATCH] add bstats

---
 pom.xml                                       | 21 ++++++++++++++++++-
 .../m724/realweather/RealWeatherPlugin.java   |  5 ++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6d6641c..4910ad2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,18 @@
 		    <artifactId>jarupdater</artifactId>
 		    <version>0.1.0</version>
 		</dependency>
+		<dependency>
+			<groupId>eu.m724</groupId>
+			<artifactId>jarupdater</artifactId>
+			<version>0.1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.bstats</groupId>
+			<artifactId>bstats-bukkit</artifactId>
+			<version>3.0.3</version>
+			<scope>compile</scope>
+		</dependency>
+
 	</dependencies>
 	
     <build>
@@ -69,7 +81,14 @@
               				<goal>shade</goal>
             			</goals>
             			<configuration>
-              				<artifactSet>
+							<relocations>
+								<relocation>
+									<pattern>org.bstats</pattern>
+									<!-- Replace this with your package! -->
+									<shadedPattern>eu.m724.realweather</shadedPattern>
+								</relocation>
+							</relocations>
+							<artifactSet>
                 				<includes>
                   					<include>eu.m724:wtapi</include>
                   					<include>eu.m724:jarupdater</include>
diff --git a/src/main/java/eu/m724/realweather/RealWeatherPlugin.java b/src/main/java/eu/m724/realweather/RealWeatherPlugin.java
index dc9f8dd..9f84ba8 100644
--- a/src/main/java/eu/m724/realweather/RealWeatherPlugin.java
+++ b/src/main/java/eu/m724/realweather/RealWeatherPlugin.java
@@ -6,6 +6,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.logging.Logger;
 
+import org.bstats.bukkit.Metrics;
 import org.bukkit.configuration.file.YamlConfiguration;
 import org.bukkit.plugin.java.JavaPlugin;
 
@@ -138,7 +139,9 @@ public class RealWeatherPlugin extends JavaPlugin {
 		
 		if (GlobalConstants.weatherConfig.enabled)
 			getCommand("localweather").setExecutor(new LocalWeatherCommand());
-		
+
+		new Metrics(this, 15020);
+
 		DebugLogger.info("ended loading", 1);
 	}