Skip to content

Commit

Permalink
b-stats update, code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
VetheonGames committed Sep 14, 2021
1 parent c60c521 commit 7cb5212
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 9 deletions.
30 changes: 29 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>veth.vetheon</groupId>
<artifactId>SurvivalPlus</artifactId>
<version>4.0.1-RELEASE</version>
<version>4.0.2-RELEASE</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down Expand Up @@ -49,6 +49,13 @@
<version>5.0.0</version>
<scope>compile</scope>
</dependency>
<!-- bStats -->
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>2.2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

<profiles>
Expand All @@ -65,6 +72,27 @@
<outputDirectory>/Users/ShaneBee/Desktop/Server/1-16-SP-TEST/plugins</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>veth.vetheon.metrics</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/veth/vetheon/survival/Survival.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void onEnable() {
long time = System.currentTimeMillis();

// VERSION CHECK
if (!Utils.isRunningMinecraft(1, 16)) {
if (!Utils.isRunningMinecraft(1, 17)) {
String ver = Bukkit.getServer().getBukkitVersion().split("-")[0];
Utils.log("&c-----------------------------------------------------------");
Utils.log("&cYour version is not supported: &b" + ver);
Expand All @@ -80,7 +80,7 @@ public void onEnable() {
if (!Utils.isRunningSpigot()) {
Utils.log("&c-----------------------------------------------------------");
Utils.log("&7Your server software is not supported: &c" + Bukkit.getName());
Utils.log("&7This plugin will only work on &aSpigot &7or &aPaper.");
Utils.log("&7This plugin will only work on &aSpigot &7, &aPaper &7ir, &5Purpur.");
Utils.log("&c-----------------------------------------------------------");
loaded = false;
Bukkit.getPluginManager().disablePlugin(this);
Expand Down Expand Up @@ -164,6 +164,7 @@ public void onEnable() {
}

// LOAD METRICS
int pluginId = 12789;
Metrics metrics = new Metrics(this);
Utils.log("&7Metrics " + (metrics.isEnabled() ? "&aenabled" : "&cdisabled"));

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/veth/vetheon/survival/metrics/Metrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Metrics {
// Maven's Relocate is clever and changes strings, too. So we have to use this little "trick" ... :D
final String defaultPackage = new String(
new byte[]{'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's', '.', 'b', 'u', 'k', 'k', 'i', 't'});
final String examplePackage = new String(new byte[]{'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'});
final String examplePackage = new String(new byte[]{'v', 'e', 't', 'h', '.', 'v', 'e', 't', 'h', 'e', 'o', 'n', '.', 's', 'u', 'v', 'i', 'v', 'a', 'l', '.', 'm', 'e', 't', 'r', 'i', 'c', 's'});
// We want to make sure nobody just copy & pastes the example and use the wrong package names
if (Metrics.class.getPackage().getName().equals(defaultPackage) || Metrics.class.getPackage().getName().equals(examplePackage)) {
throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
Expand Down Expand Up @@ -193,8 +193,8 @@ public JsonObject getPluginData() {
String pluginName = plugin.getDescription().getName();
String pluginVersion = plugin.getDescription().getVersion();

data.addProperty("pluginName", pluginName); // Append the name of the plugin
data.addProperty("pluginVersion", pluginVersion); // Append the version of the plugin
data.addProperty("Survival Plus", pluginName); // Append the name of the plugin
data.addProperty("4.0.1-RELEASE", pluginVersion); // Append the version of the plugin
JsonArray customCharts = new JsonArray();
for (CustomChart customChart : charts) {
// Add the data of the custom charts
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion target/classes/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: SurvivalPlus
main: veth.vetheon.survival.Survival
authors: [FattyMieo, ShaneBee, VetheonGames]
version: '4.0.1-RELEASE'
version: '4.0.2-RELEASE'
api-version: '1.17'
softdepend:
- PlaceholderAPI
Expand Down
Binary file modified target/classes/veth/vetheon/survival/Survival.class
Binary file not shown.
Binary file modified target/classes/veth/vetheon/survival/metrics/Metrics.class
Binary file not shown.
4 changes: 2 additions & 2 deletions target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven
#Sun Sep 12 17:29:40 MDT 2021
#Tue Sep 14 13:58:28 MDT 2021
groupId=veth.vetheon
artifactId=SurvivalPlus
version=4.0.1-RELEASE
version=4.0.2-RELEASE

0 comments on commit 7cb5212

Please sign in to comment.