From b63c9d20d58978739e56ccb9aee45ddb89b52950 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 24 Jan 2021 22:30:36 +1300 Subject: [PATCH] Change async team --- .../disguise/utilities/packets/PacketsManager.java | 3 ++- .../packets/packetlisteners/PacketListenerScoreboardTeam.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java index 93156bc1..551a970a 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/PacketsManager.java @@ -173,7 +173,8 @@ public class PacketsManager { if (NmsVersion.v1_13.isSupported() && DisguiseConfig.getPlayerNameType() != DisguiseConfig.PlayerNameType.ARMORSTANDS) { scoreboardTeamListener = new PacketListenerScoreboardTeam(); - ProtocolLibrary.getProtocolManager().getAsynchronousManager().registerAsyncHandler(scoreboardTeamListener); + + ProtocolLibrary.getProtocolManager().addPacketListener(scoreboardTeamListener); } } } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerScoreboardTeam.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerScoreboardTeam.java index 7d4ecb6f..55b0d6fb 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerScoreboardTeam.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerScoreboardTeam.java @@ -1,6 +1,7 @@ package me.libraryaddict.disguise.utilities.packets.packetlisteners; import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.events.ListenerOptions; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; @@ -21,7 +22,7 @@ import java.util.Set; */ public class PacketListenerScoreboardTeam extends PacketAdapter { public PacketListenerScoreboardTeam() { - super(LibsDisguises.getInstance(), PacketType.Play.Server.SCOREBOARD_TEAM); + super(new AdapterParameteters().optionAsync().plugin(LibsDisguises.getInstance()).types(PacketType.Play.Server.SCOREBOARD_TEAM)); } @Override