mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 20:43:11 +00:00
Fix reporting of economy backend to bStats
This commit is contained in:
parent
1a6ad2fdb0
commit
6f149224d1
3 changed files with 17 additions and 4 deletions
|
@ -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()) {
|
||||||
|
backend.put(Methods.getMethod().getBackend(), 1);
|
||||||
result.put(Methods.getMethod().getName(), backend);
|
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…
Add table
Add a link
Reference in a new issue