3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 15:00:09 +01:00
Dieser Commit ist enthalten in:
Matsv 2016-09-30 20:09:03 +02:00
Commit 313b794285
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 97CEC2A2EA31350F
3 geänderte Dateien mit 19 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -19,11 +19,16 @@ import us.myles.ViaVersion.bungee.commands.BungeeCommand;
import us.myles.ViaVersion.bungee.commands.BungeeCommandHandler; import us.myles.ViaVersion.bungee.commands.BungeeCommandHandler;
import us.myles.ViaVersion.bungee.commands.BungeeCommandSender; import us.myles.ViaVersion.bungee.commands.BungeeCommandSender;
import us.myles.ViaVersion.bungee.platform.*; import us.myles.ViaVersion.bungee.platform.*;
import us.myles.ViaVersion.dump.PluginInfo;
import us.myles.ViaVersion.util.GsonUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class Bungee extends Plugin implements ViaPlatform, Listener { public class BungeePlugin extends Plugin implements ViaPlatform, Listener {
private BungeeViaAPI api; private BungeeViaAPI api;
private BungeeConfigAPI config; private BungeeConfigAPI config;
@ -137,7 +142,16 @@ public class Bungee extends Plugin implements ViaPlatform, Listener {
@Override @Override
public JsonObject getDump() { public JsonObject getDump() {
return new JsonObject(); 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(), Arrays.asList(p.getDescription().getAuthor())));
platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins));
// TODO more? ProtocolLib things etc?
return platformSpecific;
} }
@EventHandler @EventHandler

Datei anzeigen

@ -1,4 +1,4 @@
name: ViaVersion name: ViaVersion
main: us.myles.ViaVersion.Bungee main: us.myles.ViaVersion.BungeePlugin
author: _MylesC author: _MylesC, Matsv
version: ${project.version} version: ${project.version}

Datei anzeigen

@ -57,7 +57,7 @@ public class DumpSubCmd extends ViaSubCommand {
con.setDoOutput(true); con.setDoOutput(true);
OutputStream out = con.getOutputStream(); OutputStream out = con.getOutputStream();
out.write(GsonUtil.getGson().toJson(template).getBytes(Charset.forName("UTF-8"))); out.write(GsonUtil.getGsonBuilder().setPrettyPrinting().create().toJson(template).getBytes(Charset.forName("UTF-8")));
out.close(); out.close();
JsonObject output = GsonUtil.getGson().fromJson(new InputStreamReader(con.getInputStream()), JsonObject.class); JsonObject output = GsonUtil.getGson().fromJson(new InputStreamReader(con.getInputStream()), JsonObject.class);