mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-30 12:00:34 +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", () -> {
|
metrics.addCustomChart(new Metrics.DrilldownPie("econPlugin", () -> {
|
||||||
Map<String, Map<String, Integer>> result = new HashMap<>();
|
Map<String, Map<String, Integer>> result = new HashMap<>();
|
||||||
Map<String, Integer> backend = new HashMap<>();
|
Map<String, Integer> backend = new HashMap<>();
|
||||||
backend.put(Methods.getMethod().getPlugin().getName(), 1);
|
if (Methods.hasMethod()) {
|
||||||
result.put(Methods.getMethod().getName(), backend);
|
backend.put(Methods.getMethod().getBackend(), 1);
|
||||||
|
result.put(Methods.getMethod().getName(), backend);
|
||||||
|
} else {
|
||||||
|
backend.put("Essentials", 1);
|
||||||
|
result.put("Essentials", backend);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,13 @@ public interface Method {
|
|||||||
*/
|
*/
|
||||||
String getName();
|
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.
|
* Returns the reported name of this method.
|
||||||
*
|
*
|
||||||
|
@ -29,13 +29,14 @@ public class VaultEco implements Method {
|
|||||||
return this.vault.getDescription().getName();
|
return this.vault.getDescription().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEconomy() {
|
@Override
|
||||||
|
public String getBackend() {
|
||||||
return economy == null ? "NoEco" : economy.getName();
|
return economy == null ? "NoEco" : economy.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLongName() {
|
public String getLongName() {
|
||||||
return getName().concat(" - Economy: ").concat(getEconomy());
|
return getName().concat(" - Economy: ").concat(getBackend());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user