mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 17:57:34 +01:00
SPIGOT-7123: NullPointerException thrown by Player#chat method
By: md_5 <git@md-5.net>
This commit is contained in:
parent
f8db65033c
commit
8e9f13befb
@ -30,8 +30,7 @@ import net.minecraft.advancements.AdvancementProgress;
|
|||||||
import net.minecraft.core.BlockPosition;
|
import net.minecraft.core.BlockPosition;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.PacketDataSerializer;
|
import net.minecraft.network.PacketDataSerializer;
|
||||||
import net.minecraft.network.chat.ChatMessageType;
|
import net.minecraft.network.chat.ChatMessageContent;
|
||||||
import net.minecraft.network.chat.ChatSender;
|
|
||||||
import net.minecraft.network.chat.IChatBaseComponent;
|
import net.minecraft.network.chat.IChatBaseComponent;
|
||||||
import net.minecraft.network.chat.PlayerChatMessage;
|
import net.minecraft.network.chat.PlayerChatMessage;
|
||||||
import net.minecraft.network.protocol.game.ClientboundClearTitlesPacket;
|
import net.minecraft.network.protocol.game.ClientboundClearTitlesPacket;
|
||||||
@ -381,7 +380,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public void chat(String msg) {
|
public void chat(String msg) {
|
||||||
if (getHandle().connection == null) return;
|
if (getHandle().connection == null) return;
|
||||||
|
|
||||||
getHandle().connection.chat(msg, null, false);
|
getHandle().connection.chat(msg, PlayerChatMessage.system(new ChatMessageContent(msg)), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user