Added metrics & made UpdateChecker optional
This commit is contained in:
parent
383b99114a
commit
a881adb64a
3 changed files with 39 additions and 11 deletions
21
pom.xml
21
pom.xml
|
@ -52,9 +52,16 @@
|
|||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>nl.SBDeveloper.V10Lift.Metrics</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>shade</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
|
@ -135,6 +142,10 @@
|
|||
<id>iobyte-repo</id>
|
||||
<url>https://nexus.iobyte.nl/repository/maven-public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>CodeMC</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -173,6 +184,14 @@
|
|||
<artifactId>jackson-module-parameter-names</artifactId>
|
||||
<version>2.10.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- BStats, used for metrics -->
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>1.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -8,9 +8,11 @@ import nl.SBDeveloper.V10Lift.Listeners.EntityDamageListener;
|
|||
import nl.SBDeveloper.V10Lift.Listeners.PlayerInteractListener;
|
||||
import nl.SBDeveloper.V10Lift.Listeners.SignChangeListener;
|
||||
import nl.SBDeveloper.V10Lift.Managers.DBManager;
|
||||
import nl.SBDeveloper.V10Lift.Managers.DataManager;
|
||||
import nl.SBDevelopment.SBUtilities.Data.YamlFile;
|
||||
import nl.SBDevelopment.SBUtilities.PrivateManagers.UpdateManager;
|
||||
import nl.SBDevelopment.SBUtilities.SBUtilities;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
|
@ -55,7 +57,12 @@ public class V10LiftPlugin extends JavaPlugin {
|
|||
Bukkit.getPluginManager().registerEvents(new SignChangeListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new EntityDamageListener(), this);
|
||||
|
||||
//Load metrics
|
||||
Metrics metrics = new Metrics(this, 6564);
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("lifts", () -> DataManager.getLifts().size()));
|
||||
|
||||
//Load the update checker
|
||||
if (getSConfig().getFile().getBoolean("CheckUpdates")) {
|
||||
new UpdateManager(this, 72317, UpdateManager.CheckType.SPIGOT).handleResponse((versionResponse, version) -> {
|
||||
if (versionResponse == UpdateManager.VersionResponse.FOUND_NEW) {
|
||||
Bukkit.getLogger().warning("[V10Lift] There is a new version available! Current: " + this.getDescription().getVersion() + " New: " + version);
|
||||
|
@ -65,6 +72,7 @@ public class V10LiftPlugin extends JavaPlugin {
|
|||
Bukkit.getLogger().severe("[V10Lift] Unable to perform an update check.");
|
||||
}
|
||||
}).check();
|
||||
}
|
||||
|
||||
Bukkit.getLogger().info("[V10Lift] Plugin loaded successfully!");
|
||||
}
|
||||
|
|
|
@ -10,3 +10,4 @@ MasterRepairAmount: 10
|
|||
DefaultSpeed: 16
|
||||
DefaultRealistic: true
|
||||
DoorCloseTime: 100
|
||||
CheckUpdates: true
|
Loading…
Reference in a new issue