mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-12-23 01:21:47 +00:00
Added Graph "Shop Type" to Statistics Page (Still Testing)
This commit is contained in:
parent
375c37b7dc
commit
49530f806d
@ -2,7 +2,7 @@
|
||||
|
||||
name: ShopChest
|
||||
main: de.epiceric.shopchest.ShopChest
|
||||
version: 1.6.0
|
||||
version: 1.6.0.1
|
||||
author: EpicEric
|
||||
website: https://www.spigotmc.org/resources/shopchest.11431/
|
||||
depend: [Vault]
|
||||
|
@ -39,6 +39,8 @@ import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R1;
|
||||
import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R2;
|
||||
import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R3;
|
||||
import de.epiceric.shopchest.utils.Metrics;
|
||||
import de.epiceric.shopchest.utils.Metrics.Graph;
|
||||
import de.epiceric.shopchest.utils.Metrics.Plotter;
|
||||
import de.epiceric.shopchest.utils.ShopUtils;
|
||||
import de.epiceric.shopchest.utils.UpdateChecker;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
@ -104,6 +106,37 @@ public class ShopChest extends JavaPlugin{
|
||||
|
||||
try {
|
||||
Metrics metrics = new Metrics(this);
|
||||
Graph shopType = metrics.createGraph("Shop Type");
|
||||
|
||||
shopType.addPlotter(new Plotter("Infinite") {
|
||||
|
||||
@Override
|
||||
public int getValue() {
|
||||
int value = 0;
|
||||
|
||||
for (Shop shop : ShopUtils.getShops()) {
|
||||
if (shop.isInfinite()) value++;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
});
|
||||
|
||||
shopType.addPlotter(new Plotter("Normal") {
|
||||
|
||||
@Override
|
||||
public int getValue() {
|
||||
int value = 0;
|
||||
|
||||
for (Shop shop : ShopUtils.getShops()) {
|
||||
if (!shop.isInfinite()) value++;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
metrics.start();
|
||||
} catch (IOException e) {
|
||||
logger.severe("Could not submit stats.");
|
||||
|
Loading…
Reference in New Issue
Block a user