Fixed null error when sending skin overlay data to update players' clients.

This commit is contained in:
Luis C.M committed 2022-07-05 14:18:40 -05:00
1 parent 34dd42f0db
commit 8e0b5d042c
1 file changed
+8 -6
@@ -49,12 +49,14 @@ public class DataSkinOverlays implements IOverlayHandler {
}
public void updateClient() {
if (parent instanceof PlayerData) {
NBTTagCompound compound = this.writeToNBT(new NBTTagCompound());
((PlayerData) parent).player.getEntityData().setTag("SkinOverlayData", compound.getTagList("SkinOverlayData",10));
Server.sendToAll(EnumPacketClient.PLAYER_UPDATE_SKIN_OVERLAYS, ((PlayerData) parent).player.getCommandSenderName(), compound);
} else if (parent instanceof EntityNPCInterface) {
((EntityNPCInterface) parent).updateClient = true;
if (parent != null) {
if (parent instanceof PlayerData && ((PlayerData) parent).player != null) {
NBTTagCompound compound = this.writeToNBT(new NBTTagCompound());
((PlayerData) parent).player.getEntityData().setTag("SkinOverlayData", compound.getTagList("SkinOverlayData", 10));
Server.sendToAll(EnumPacketClient.PLAYER_UPDATE_SKIN_OVERLAYS, ((PlayerData) parent).player.getCommandSenderName(), compound);
} else if (parent instanceof EntityNPCInterface) {
((EntityNPCInterface) parent).updateClient = true;
}
}
}