use of com.viaversion.viaversion.dump.PluginInfo in project ViaVersion by ViaVersion.
the class ViaVersionPlugin method getDump.
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();
List<PluginInfo> plugins = new ArrayList<>();
for (Plugin p : Bukkit.getPluginManager().getPlugins()) plugins.add(new PluginInfo(p.isEnabled(), p.getDescription().getName(), p.getDescription().getVersion(), p.getDescription().getMain(), p.getDescription().getAuthors()));
platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins));
return platformSpecific;
}
use of com.viaversion.viaversion.dump.PluginInfo in project ViaVersion by ViaVersion.
the class BungeePlugin method getDump.
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();
List<PluginInfo> plugins = new ArrayList<>();
for (Plugin p : ProxyServer.getInstance().getPluginManager().getPlugins()) plugins.add(new PluginInfo(true, p.getDescription().getName(), p.getDescription().getVersion(), p.getDescription().getMain(), Collections.singletonList(p.getDescription().getAuthor())));
platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins));
platformSpecific.add("servers", GsonUtil.getGson().toJsonTree(ProtocolDetectorService.getDetectedIds()));
return platformSpecific;
}
use of com.viaversion.viaversion.dump.PluginInfo in project ViaVersion by ViaVersion.
the class SpongePlugin method getDump.
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();
List<PluginInfo> plugins = new ArrayList<>();
for (PluginContainer plugin : game.pluginManager().plugins()) {
PluginMetadata metadata = plugin.metadata();
plugins.add(new PluginInfo(true, metadata.name().orElse("Unknown"), metadata.version().toString(), plugin.instance().getClass().getCanonicalName(), metadata.contributors().stream().map(PluginContributor::name).collect(Collectors.toList())));
}
platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins));
return platformSpecific;
}
use of com.viaversion.viaversion.dump.PluginInfo in project ViaVersion by ViaVersion.
the class VelocityPlugin method getDump.
@Override
public JsonObject getDump() {
JsonObject extra = new JsonObject();
List<PluginInfo> plugins = new ArrayList<>();
for (PluginContainer p : PROXY.getPluginManager().getPlugins()) {
plugins.add(new PluginInfo(true, p.getDescription().getName().orElse(p.getDescription().getId()), p.getDescription().getVersion().orElse("Unknown Version"), p.getInstance().isPresent() ? p.getInstance().get().getClass().getCanonicalName() : "Unknown", p.getDescription().getAuthors()));
}
extra.add("plugins", GsonUtil.getGson().toJsonTree(plugins));
extra.add("servers", GsonUtil.getGson().toJsonTree(ProtocolDetectorService.getDetectedIds()));
return extra;
}
Aggregations