mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-18 11:45:07 +08:00
Fix reporting of economy backend to bStats
This commit is contained in:
parent
1a6ad2fdb0
commit
6f149224d1
@ -65,8 +65,13 @@ public class MetricsWrapper {
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("econPlugin", () -> {
|
||||
Map<String, Map<String, Integer>> result = new HashMap<>();
|
||||
Map<String, Integer> backend = new HashMap<>();
|
||||
backend.put(Methods.getMethod().getPlugin().getName(), 1);
|
||||
result.put(Methods.getMethod().getName(), backend);
|
||||
if (Methods.hasMethod()) {
|
||||
backend.put(Methods.getMethod().getBackend(), 1);
|
||||
result.put(Methods.getMethod().getName(), backend);
|
||||
} else {
|
||||
backend.put("Essentials", 1);
|
||||
result.put("Essentials", backend);
|
||||
}
|
||||
return result;
|
||||
}));
|
||||
}
|
||||
|
@ -33,6 +33,13 @@ public interface Method {
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Returns the backend plugin of this economy method, if applicable.
|
||||
*
|
||||
* @return <code>String</code> Plugin name.
|
||||
*/
|
||||
String getBackend();
|
||||
|
||||
/**
|
||||
* Returns the reported name of this method.
|
||||
*
|
||||
|
@ -29,13 +29,14 @@ public class VaultEco implements Method {
|
||||
return this.vault.getDescription().getName();
|
||||
}
|
||||
|
||||
public String getEconomy() {
|
||||
@Override
|
||||
public String getBackend() {
|
||||
return economy == null ? "NoEco" : economy.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName() {
|
||||
return getName().concat(" - Economy: ").concat(getEconomy());
|
||||
return getName().concat(" - Economy: ").concat(getBackend());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user