Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
add bstats
Browse files Browse the repository at this point in the history
Former-commit-id: 3ce01df
  • Loading branch information
Ghost-chu committed Sep 23, 2018
1 parent 328fe35 commit 72a6077
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 5 deletions.
39 changes: 36 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>Reremake 1.2.0-beta8</version>
<version>Reremake 1.2.0-beta9</version>
<!-- Fuck version -->
<licenses>
<license>
Expand Down Expand Up @@ -35,6 +36,28 @@
<target>1.8</target>
</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>
<!-- Replace this with your package! -->
<shadedPattern>org.maxgamer.quickshop</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
Expand All @@ -44,7 +67,7 @@
</resources>
</build>
<repositories>
<repository>
<repository>
<id>fanciful-repo</id>
<url>https://github.com/mkremins/fanciful/tree/mvn-repo</url>
</repository>
Expand All @@ -60,6 +83,10 @@
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>bstats-repo</id>
<url>http://repo.bstats.org/content/repositories/releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
Expand All @@ -69,6 +96,12 @@
<version>7.0.0</version>
<systemPath>${basedir}/lib/worldguard-legacy-7.0.0-SNAPSHOT-dist.jar</systemPath>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
Expand Down
21 changes: 20 additions & 1 deletion src/main/java/org/maxgamer/quickshop/QuickShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map.Entry;
import java.util.UUID;

import org.bstats.bukkit.Metrics;
import org.bstats.bukkit.Metrics.CustomChart;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
Expand All @@ -24,6 +27,7 @@
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
Expand Down Expand Up @@ -124,7 +128,7 @@ public int getShopLimit(Player p) {

public void onEnable() {
getLogger().info("Quickshop Reremake by Ghost_chu(Minecraft SunnySide Server Community)");
getLogger().info("THIS VERSION ONLY SUPPORT BUKKIT API 1.13 VERSION! (Not included 1.13.x)");
getLogger().info("THIS VERSION ONLY SUPPORT BUKKIT API 1.13-1.13.x VERSION!");
getLogger().info("Author:Ghost_chu");
getLogger().info("Original author:Netherfoam, Timtower, KaiNoMood");
getLogger().info("Let's us start load plugin");
Expand All @@ -146,6 +150,21 @@ public void onEnable() {
getLogger().info("Couldn't find a Vault permission provider. Some feature may be limited.");
}

//Metrics
if(getConfig().getBoolean("metrics")) {
PluginDescriptionFile pdf = Bukkit.getServer().getPluginManager().getPlugin("QuickShop").getDescription();
String qsVer = pdf.getVersion();
Metrics metrics = new Metrics(this);
//Version
metrics.addCustomChart(new Metrics.SimplePie("QuickShop Reremake Version", () -> qsVer));
//Language Env
Locale locale = Locale.getDefault();
metrics.addCustomChart(new Metrics.SimplePie("Country", () -> String.valueOf(locale)));
getLogger().info("This computer using language: "+String.valueOf(locale));
}else {
getLogger().info("Metrics is disabled, Skipping...");
}

// Initialize Util
Util.initialize();

Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ whole-number-prices-only: false
#Force bukkit chat handler (https://github.com/KaiKikuchi/QuickShop/issues/10)
force-bukkit-chat-handler: false

#Allow QuickShop-Reremake send anonymous metrics data to bStats.
metrics: true

database:
mysql: false
host: localhost
Expand Down Expand Up @@ -141,7 +144,7 @@ protect:
structuregrow: false
#Protect shop block can or cannot break by Entity and Block explode
explode: false
#Protect shop block can or cannot pull out by Hopper
#Protect shop block can or cannot pull out by Hopper
hopper: false
#You can translate QuickShop display name in there
# - BukkitName:TranslatedName
Expand All @@ -152,6 +155,9 @@ lockette:
private: "[Private]"
more_users: "[More Users]"
#Make Quickshop not cancel break lock sign event(Inpossible break locked chest)

#Float items advanced filter manager
#These all in testing and have many bugs, Use your own risk!
float:
enable: false
#If this is disabled, all options after this will not working.
Expand Down

0 comments on commit 72a6077

Please sign in to comment.