Made super ugly change to how prefix/suffix works by not splitting them at all because MC doesn't look to care about char limits

This commit is contained in:
libraryaddict
2020-07-05 10:38:44 +12:00
parent 6e456e4702
commit ce884cc8ac
3 changed files with 12 additions and 6 deletions

View File

@@ -169,7 +169,7 @@ public class PacketsManager {
ProtocolLibrary.getProtocolManager().addPacketListener(mainListener);
ProtocolLibrary.getProtocolManager().addPacketListener(destroyListener);
if (NmsVersion.v1_16.isSupported()) {
if (NmsVersion.v1_13.isSupported()) {
scoreboardTeamListener = new PacketListenerScoreboardTeam();
ProtocolLibrary.getProtocolManager().addPacketListener(scoreboardTeamListener);
}

View File

@@ -13,7 +13,7 @@ import me.libraryaddict.disguise.disguisetypes.TargetedDisguise;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.chat.ComponentSerializer;
import org.bukkit.plugin.Plugin;
import org.apache.commons.lang.StringUtils;
import java.util.Set;
@@ -30,7 +30,7 @@ public class PacketListenerScoreboardTeam extends PacketAdapter {
PacketContainer packet = event.getPacket();
String name = packet.getStrings().read(0);
if (!name.startsWith("LD_")) {
if (!name.startsWith("LD_") || name.equals("LD_NoName") || name.equals("LD_Pushing")) {
return;
}
@@ -53,6 +53,7 @@ public class PacketListenerScoreboardTeam extends PacketAdapter {
}
StructureModifier<WrappedChatComponent> chats = packet.getChatComponents();
BaseComponent[] prefix = DisguiseUtilities.getColoredChat(team.getPrefix());
BaseComponent[] suffix = DisguiseUtilities.getColoredChat(team.getSuffix());