improved PacketPlayOutChat

This commit is contained in:
NEZNAMY committed 2020-03-25 23:38:27 +01:00
1 parent 0d4d695b29
commit 3dffec8942
2 files changed
+8 -4

No files matched your search

+1 -2
View File
@@ -12,7 +12,6 @@ import me.neznamy.tab.platforms.bukkit.*;
import me.neznamy.tab.premium.Premium;
import me.neznamy.tab.shared.features.*;
import me.neznamy.tab.shared.packets.*;
import me.neznamy.tab.shared.packets.PacketPlayOutChat.ChatMessageType;
import me.neznamy.tab.shared.placeholders.*;
public class Shared {
@@ -73,7 +72,7 @@ public class Shared {
if (Premium.is()) return;
IChatBaseComponent message = new IChatBaseComponent("TAB v" + pluginVersion).setColor(EnumChatFormat.DARK_AQUA).onHoverShowText(Placeholders.colorChar + "aClick to visit plugin's spigot page").onClickOpenUrl("https://www.spigotmc.org/resources/57806/");
message.addExtra(new IChatBaseComponent(" by _NEZNAMY_ (discord: NEZNAMY#4659)").setColor(EnumChatFormat.BLACK));
to.sendCustomPacket(new PacketPlayOutChat(message, ChatMessageType.CHAT));
to.sendCustomPacket(new PacketPlayOutChat(message));
}
public static void load(boolean inject) {
try {
@@ -9,9 +9,14 @@ public class PacketPlayOutChat extends UniversalPacketPlayOut{
private IChatBaseComponent message;
private ChatMessageType type;
public PacketPlayOutChat(String message) {
this(message, ChatMessageType.CHAT);
}
public PacketPlayOutChat(IChatBaseComponent message) {
this(message, ChatMessageType.CHAT);
}
public PacketPlayOutChat(String message, ChatMessageType type) {
this.message = IChatBaseComponent.fromColoredText(message);
this.type = type;
this(IChatBaseComponent.fromColoredText(message), type);
}
public PacketPlayOutChat(IChatBaseComponent message, ChatMessageType type) {
this.message = message;