mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-26 10:29:49 -05:00
improved PacketPlayOutChat
This commit is contained in:
1 parent
0d4d695b29
commit
3dffec8942
2 files changed
+8
-4
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user