Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-20 06:50:08 +01:00
Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular
Dieser Commit ist enthalten in:
Commit
313b794285
@ -19,11 +19,16 @@ import us.myles.ViaVersion.bungee.commands.BungeeCommand;
|
||||
import us.myles.ViaVersion.bungee.commands.BungeeCommandHandler;
|
||||
import us.myles.ViaVersion.bungee.commands.BungeeCommandSender;
|
||||
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.concurrent.TimeUnit;
|
||||
|
||||
public class Bungee extends Plugin implements ViaPlatform, Listener {
|
||||
public class BungeePlugin extends Plugin implements ViaPlatform, Listener {
|
||||
|
||||
private BungeeViaAPI api;
|
||||
private BungeeConfigAPI config;
|
||||
@ -137,7 +142,16 @@ public class Bungee extends Plugin implements ViaPlatform, Listener {
|
||||
|
||||
@Override
|
||||
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
|
@ -1,4 +1,4 @@
|
||||
name: ViaVersion
|
||||
main: us.myles.ViaVersion.Bungee
|
||||
author: _MylesC
|
||||
main: us.myles.ViaVersion.BungeePlugin
|
||||
author: _MylesC, Matsv
|
||||
version: ${project.version}
|
@ -57,7 +57,7 @@ public class DumpSubCmd extends ViaSubCommand {
|
||||
con.setDoOutput(true);
|
||||
|
||||
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();
|
||||
|
||||
JsonObject output = GsonUtil.getGson().fromJson(new InputStreamReader(con.getInputStream()), JsonObject.class);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren