Fix ChatExtensions exception

Fixes #1045
This commit is contained in:
Dan Mulloy 2021-01-02 23:19:20 -05:00
parent 13b3d8679d
commit b7132196fb
No known key found for this signature in database
GPG Key ID: BFACD592A5F0DFD6
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -94,6 +95,7 @@ public class ChatExtensions {
for (WrappedChatComponent component : components) {
PacketContainer packet = new PacketContainer(PacketType.Play.Server.CHAT);
packet.getChatComponents().write(0, component);
packet.getChatTypes().write(0, EnumWrappers.ChatType.SYSTEM);
if (MinecraftVersion.NETHER_UPDATE_2.atOrAbove()) {
packet.getUUIDs().write(0, SERVER_UUID);
}