Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-08 04:20:06 +01:00
Update bStats adding ID
Dieser Commit ist enthalten in:
Ursprung
37003ec089
Commit
93ebd21a61
@ -105,6 +105,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
|||||||
private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class);
|
private static final Logger log = LoggerFactory.getLogger(WorldEditPlugin.class);
|
||||||
public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui";
|
public static final String CUI_PLUGIN_CHANNEL = "worldedit:cui";
|
||||||
private static WorldEditPlugin INSTANCE;
|
private static WorldEditPlugin INSTANCE;
|
||||||
|
private static final int BSTATS_ID = 1403;
|
||||||
|
|
||||||
private BukkitImplAdapter bukkitAdapter;
|
private BukkitImplAdapter bukkitAdapter;
|
||||||
private BukkitServerInterface server;
|
private BukkitServerInterface server;
|
||||||
@ -229,7 +230,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enable metrics
|
// Enable metrics
|
||||||
new Metrics(this);
|
new Metrics(this, BSTATS_ID);
|
||||||
PaperLib.suggestPaper(this);
|
PaperLib.suggestPaper(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,16 +70,21 @@ public class Metrics {
|
|||||||
// The plugin
|
// The plugin
|
||||||
private final Plugin plugin;
|
private final Plugin plugin;
|
||||||
|
|
||||||
|
// The plugin id
|
||||||
|
private final int bstatsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor.
|
* Class constructor.
|
||||||
*
|
*
|
||||||
* @param plugin The plugin which stats should be submitted.
|
* @param plugin The plugin which stats should be submitted.
|
||||||
|
* @param bstatsId The ID of the plugin. It can be found in the url when you open the plugin on bStats.
|
||||||
*/
|
*/
|
||||||
public Metrics(Plugin plugin) {
|
public Metrics(Plugin plugin, int bstatsId) {
|
||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
throw new IllegalArgumentException("Plugin cannot be null!");
|
throw new IllegalArgumentException("Plugin cannot be null!");
|
||||||
}
|
}
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
this.bstatsId = bstatsId;
|
||||||
|
|
||||||
// Get the config file
|
// Get the config file
|
||||||
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
||||||
@ -181,6 +186,7 @@ public class Metrics {
|
|||||||
String pluginVersion = plugin.getDescription().getVersion();
|
String pluginVersion = plugin.getDescription().getVersion();
|
||||||
|
|
||||||
data.addProperty("pluginName", pluginName); // Append the name of the plugin
|
data.addProperty("pluginName", pluginName); // Append the name of the plugin
|
||||||
|
data.addProperty("id", bstatsId); // Append the id of the plugin
|
||||||
data.addProperty("pluginVersion", pluginVersion); // Append the version of the plugin
|
data.addProperty("pluginVersion", pluginVersion); // Append the version of the plugin
|
||||||
data.add("customCharts", new JsonArray());
|
data.add("customCharts", new JsonArray());
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren