Update bStats Metrics and add wrapper class for new graphs (#3451)

This PR updates the version of the bStats Metrics class to the latest version, supporting plugin IDs in place of just plugin names. It also adds the following graphs:
- Active permissions backend
- Active economy backend
- Whether or not a command has been used as a bar chart (pending bStats backend implementation)
- Version history graph as a multiline graph (also pending bStats impl)

It also removes the weird `getMetrics` and `setMetrics` APIs which should never have been API in the first place.
This commit is contained in:
MD 2020-07-05 19:30:01 +01:00 committed by GitHub
parent 8f86849aec
commit 1be3daf0b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 212 additions and 58 deletions

View file

@ -1,6 +1,6 @@
package com.earth2me.essentials.spawn;
import com.earth2me.essentials.metrics.Metrics;
import com.earth2me.essentials.metrics.MetricsWrapper;
import net.ess3.api.IEssentials;
import org.bukkit.Location;
import org.bukkit.command.Command;
@ -19,7 +19,7 @@ import static com.earth2me.essentials.I18n.tl;
public class EssentialsSpawn extends JavaPlugin implements IEssentialsSpawn {
private transient IEssentials ess;
private transient SpawnStorage spawns;
private transient Metrics metrics = null;
private transient MetricsWrapper metrics = null;
@Override
public void onEnable() {
@ -51,7 +51,7 @@ public class EssentialsSpawn extends JavaPlugin implements IEssentialsSpawn {
}
if (metrics == null) {
metrics = new Metrics(this);
metrics = new MetricsWrapper(this, 3817, true);
}
}
@ -61,6 +61,7 @@ public class EssentialsSpawn extends JavaPlugin implements IEssentialsSpawn {
@Override
public boolean onCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args) {
metrics.markCommand(command.getName(), true);
return ess.onCommandEssentials(sender, command, commandLabel, args, EssentialsSpawn.class.getClassLoader(), "com.earth2me.essentials.spawn.Command", "essentials.", spawns);
}