mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 02:25:49 +01:00
Merge pull request #222 from elytraa/bungee-destination
Use ServerConnectedEvent for bungee relay
This commit is contained in:
commit
69176c379b
@ -4,7 +4,7 @@ import com.google.common.io.ByteArrayDataOutput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.sekwah.advancedportals.bungee.AdvancedPortalsPlugin;
|
||||
import com.sekwah.advancedportals.bungee.BungeeMessages;
|
||||
import net.md_5.bungee.api.event.ServerSwitchEvent;
|
||||
import net.md_5.bungee.api.event.ServerConnectedEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
@ -14,7 +14,7 @@ public class EventListener implements Listener {
|
||||
public EventListener(AdvancedPortalsPlugin plugin) { this.plugin = plugin; }
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerSwitchServer(ServerSwitchEvent event) {
|
||||
public void onServerConnected(ServerConnectedEvent event) {
|
||||
String uuid = event.getPlayer().getUniqueId().toString();
|
||||
|
||||
if (plugin.PlayerDestiMap.containsKey(uuid)) {
|
||||
|
@ -32,10 +32,7 @@ public class PluginMessageReceiver implements Listener {
|
||||
String targetUUID = in.readUTF();
|
||||
|
||||
plugin.PlayerDestiMap.put(targetUUID, new String[]{targetServer, targetDestination, targetUUID});
|
||||
|
||||
plugin.getProxy().getScheduler().schedule(plugin, () -> {
|
||||
plugin.PlayerDestiMap.remove(targetUUID);
|
||||
}, 20, TimeUnit.SECONDS);
|
||||
plugin.PlayerDestiMap.remove(targetUUID);
|
||||
}
|
||||
else if (subChannel.equalsIgnoreCase(BungeeMessages.BUNGEE_COMMAND)) {
|
||||
String command = in.readUTF();
|
||||
|
Loading…
Reference in New Issue
Block a user