3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-04 23:30:24 +01:00

Implement removePortedClient on Bungee

Dieser Commit ist enthalten in:
Matsv 2016-09-30 16:20:29 +02:00
Ursprung b7b322a525
Commit b2df970af5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 97CEC2A2EA31350F

Datei anzeigen

@ -4,7 +4,10 @@ import com.google.gson.JsonObject;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.event.EventHandler;
import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.ViaAPI; import us.myles.ViaVersion.api.ViaAPI;
import us.myles.ViaVersion.api.ViaVersionConfig; import us.myles.ViaVersion.api.ViaVersionConfig;
@ -20,7 +23,7 @@ import us.myles.ViaVersion.bungee.platform.*;
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 { public class Bungee extends Plugin implements ViaPlatform, Listener {
private BungeeViaAPI api; private BungeeViaAPI api;
private BungeeConfigAPI config; private BungeeConfigAPI config;
@ -39,6 +42,8 @@ public class Bungee extends Plugin implements ViaPlatform {
.loader(new BungeeViaLoader()) .loader(new BungeeViaLoader())
.commandHandler(commandHandler) .commandHandler(commandHandler)
.build()); .build());
getProxy().getPluginManager().registerListener(this, this);
} }
@Override @Override
@ -132,7 +137,12 @@ public class Bungee extends Plugin implements ViaPlatform {
@Override @Override
public JsonObject getDump() { public JsonObject getDump() {
return null; return new JsonObject();
}
@EventHandler
public void onQuit(PlayerDisconnectEvent e) {
Via.getManager().removePortedClient(e.getPlayer().getUniqueId());
} }
} }