예제 #1
0
        public static void ReceiveClientSettings(Player player, GameStream stream)
        {
            string   locale       = stream.ReadString();
            byte     viewDistance = stream.ReadByte();
            ChatMode chatMode     = (ChatMode)(int)stream.ReadVarInt().Value;
            bool     colors       = stream.ReadBoolean();
            byte     skinParts    = stream.ReadByte();
            VarInt   mainHand     = stream.ReadVarInt();

            player.Locale        = locale;
            player.ViewDistance  = viewDistance;
            player.ChatMode      = chatMode;
            player.ColorsEnabled = colors;

            foreach (SkinPart part in SkinParts)
            {
                if (skinParts.IsBitSet(part))
                {
                    player.DisplayedSkinParts.Add(part);
                }
            }

            player.MainHand.Value = mainHand;
            SendPlayerSlot(player, stream, player.Slot);
            // TODO - Declare Recipes
            // TODO - Set Tags
            // TODO - Set Entity Statuses
        }