LunaChat v3.0.3 : Added bStats custom chart. Related #175

このコミットが含まれているのは:
ucchy committed 2020-07-04 01:46:37 +09:00
1 親 b3ed3103e4
コミット d14840f144
2ファイル変更
+27 -2

検索条件に一致するファイルはありません

+14 -1
ファイルの表示
@@ -6,9 +6,12 @@
package com.github.ucchyocean.lc3;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import org.bstats.bukkit.Metrics;
@@ -68,7 +71,17 @@ public class LunaChatBukkit extends JavaPlugin implements PluginInterface {
LunaChat.setMode(LunaChatMode.BUKKIT);
// Metrics
new Metrics(this, 7936);
Metrics metrics = new Metrics(this, 7936);
metrics.addCustomChart(new Metrics.DrilldownPie(
"minecraft_server_version", new Callable<Map<String, Map<String, Integer>>>() {
public Map<String, Map<String, Integer>> call() throws Exception {
Map<String, Map<String, Integer>> map = new HashMap<>();
Map<String, Integer> sub = new HashMap<>();
sub.put(Bukkit.getVersion(), 1);
map.put(Bukkit.getName(), sub);
return map;
}
}));
// 変数などの初期化
config = new LunaChatConfig(getDataFolder(), getFile());
+13 -1
ファイルの表示
@@ -7,8 +7,10 @@ package com.github.ucchyocean.lc3;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import org.bstats.bungeecord.Metrics;
@@ -55,7 +57,17 @@ public class LunaChatBungee extends Plugin implements PluginInterface {
LunaChat.setMode(LunaChatMode.BUNGEE);
// Metrics
new Metrics(this, 7936);
Metrics metrics = new Metrics(this, 7936);
metrics.addCustomChart(new Metrics.DrilldownPie(
"minecraft_server_version", new Callable<Map<String, Map<String, Integer>>>() {
public Map<String, Map<String, Integer>> call() throws Exception {
Map<String, Map<String, Integer>> map = new HashMap<>();
Map<String, Integer> sub = new HashMap<>();
sub.put(getProxy().getVersion(), 1);
map.put(getProxy().getName(), sub);
return map;
}
}));
// 初期化
config = new LunaChatConfig(getDataFolder(), getFile());